mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Implement X-Forwarded-Proto
This commit is contained in:
parent
ebf114e182
commit
8f9c5f3914
@ -47,6 +47,12 @@ func proxyRequest(w http.ResponseWriter, r *http.Request, tunnel Tunnel, httpCli
|
||||
|
||||
upstreamReq.Header = downstreamReqHeaders
|
||||
|
||||
scheme := "https"
|
||||
if r.TLS == nil {
|
||||
scheme = "http"
|
||||
}
|
||||
upstreamReq.Header["X-Forwarded-Proto"] = []string{scheme}
|
||||
|
||||
upstreamReq.Header["X-Forwarded-Host"] = []string{r.Host}
|
||||
|
||||
remoteHost, _, err := net.SplitHostPort(r.RemoteAddr)
|
||||
|
Loading…
Reference in New Issue
Block a user