feat: Let port-forwarding support custom http(s) port (#5084)

This commit is contained in:
Tao Yang
2022-12-02 06:39:19 +10:00
committed by GitHub
parent 2ec3b09ca7
commit 5457dd0c65
3 changed files with 17 additions and 4 deletions
+6 -1
View File
@@ -40,8 +40,13 @@ const (
)
func (api *API) appHost(rw http.ResponseWriter, r *http.Request) {
host := api.AppHostname
if api.AccessURL.Port() != "" {
host += fmt.Sprintf(":%s", api.AccessURL.Port())
}
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.GetAppHostResponse{
Host: api.AppHostname,
Host: host,
})
}