add remoteAddr in NewProxyResp message

This commit is contained in:
fatedier
2018-01-17 14:40:08 +08:00
parent 9a5f0c23c4
commit 3f6799c06a
7 changed files with 102 additions and 60 deletions

View File

@ -110,3 +110,12 @@ func PortRangesCut(portRanges [][2]int64, port int64) [][2]int64 {
}
return tmpRanges
}
func CanonicalAddr(host string, port int) (addr string) {
if port == 80 || port == 443 {
addr = host
} else {
addr = fmt.Sprintf("%s:%d", host, port)
}
return
}