mirror of
https://github.com/boringproxy/boringproxy.git
synced 2024-07-04 11:22:57 -05:00
Set Host header to Tunnel.Domain
This commit is contained in:
parent
e7bd69ddf1
commit
efcaae77b5
|
@ -75,7 +75,10 @@ func proxyRequest(w http.ResponseWriter, r *http.Request, tunnel Tunnel, httpCli
|
|||
upstreamReq.Header.Set("X-Forwarded-For", xForwardedFor)
|
||||
upstreamReq.Header.Set("Forwarded", fmt.Sprintf("for=%s", remoteHost))
|
||||
|
||||
upstreamReq.Host = fmt.Sprintf("%s:%d", tunnel.ClientAddress, tunnel.ClientPort)
|
||||
// TODO: This might need to be more generic, but using r.Host. However,
|
||||
// I think that may have security implications for things like DNS
|
||||
// rebinding attacks. Not sure.
|
||||
upstreamReq.Host = tunnel.Domain
|
||||
|
||||
upstreamRes, err := httpClient.Do(upstreamReq)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user