More fixes

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-07-28 23:24:02 -03:00
parent 0e08107738
commit 5ee4bb2011
14 changed files with 125 additions and 49 deletions

View File

@@ -382,7 +382,11 @@ func (r *proxyRouter) handleConnection(c net.Conn) {
// It is not http neither. So just close the connection.
return
}
dstHost, err := r.director(req.Host)
host := req.Header.Get("X-Forwarded-Host")
if host == "" {
host = req.Host
}
dstHost, err := r.director(host)
if err != nil {
log.Printf("Error directing request: %v\n", err)
return