add dialer port

pull/253/head
Tufan Baris Yildirim 2019-09-18 13:29:44 +03:00
parent bd58f3c747
commit 1140dfa213
1 changed files with 1 additions and 1 deletions

View File

@ -316,7 +316,7 @@ func HttpRequest(url, method string, content interface{}, headers []string, body
Proxy: http.ProxyFromEnvironment,
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
// redirect all connections to host specified in url
addr = req.URL.Host
addr = strings.Split(req.URL.Host, ":")[0] + addr[strings.LastIndex(addr, ":"):]
return dialer.DialContext(ctx, network, addr)
},
}