Skip to content
Permalink
Browse files

Added X-Forwarded-Proto

  • Loading branch information...
antoniomika committed May 14, 2019
1 parent ebe7603 commit d4bd84c6cacf34b3cbcc61fbefd426aba19495b6
Showing with 9 additions and 1 deletion.
  1. +9 −1 http.go
10 http.go
@@ -52,6 +52,14 @@ func startHTTPHandler(state *State) {
return
}

requestedScheme := "http"

if c.Request.TLS != nil {
requestedScheme = "https"
}

c.Request.Header.Set("X-Forwarded-Proto", requestedScheme)

proxyHolder := loc.(*ProxyHolder)

url := *c.Request.URL
@@ -65,7 +73,7 @@ func startHTTPHandler(state *State) {
return net.Dial("unix", proxyHolder.ProxyTo)
}

if websocket.IsWebSocketUpgrade(c.Request) {
if c.IsWebsocket() {
scheme := "ws"
if url.Scheme == "https" {
scheme = "wss"

0 comments on commit d4bd84c

Please sign in to comment.
You can’t perform that action at this time.