tcpmux: support authentication (#3345)

This commit is contained in:
fatedier
2023-03-07 19:53:32 +08:00
committed by GitHub
parent 54eb704650
commit 862b1642ba
11 changed files with 324 additions and 71 deletions

View File

@@ -145,7 +145,10 @@ func (r *Request) Do() (*Response, error) {
err error
)
addr := net.JoinHostPort(r.addr, strconv.Itoa(r.port))
addr := r.addr
if r.port > 0 {
addr = net.JoinHostPort(r.addr, strconv.Itoa(r.port))
}
// for protocol http and https
if r.protocol == "http" || r.protocol == "https" {
return r.sendHTTPRequest(r.method, fmt.Sprintf("%s://%s%s", r.protocol, addr, r.path),