实现源站端口跟随功能

This commit is contained in:
GoEdgeLab
2022-06-29 21:58:41 +08:00
parent 18ebd8c712
commit 146a947d0b
10 changed files with 96 additions and 41 deletions

View File

@@ -41,7 +41,7 @@ func (this *HTTPRequest) doWebsocket(requestHost string) {
}
// TODO 增加N次错误重试重试的时候需要尝试不同的源站
originConn, err := OriginConnect(this.origin, this.RawReq.RemoteAddr, requestHost)
originConn, _, err := OriginConnect(this.origin, this.requestServerPort(), this.RawReq.RemoteAddr, requestHost)
if err != nil {
this.write50x(err, http.StatusBadGateway, false)