fix proxy config bug when use http proxy

This commit is contained in:
M09ic committed 2024-05-17 17:47:42 +08:00
1 parent bed943bf1c
commit b20363b4ec
1 file changed
+1 -2
+1 -2
View File
@@ -143,7 +143,6 @@ func customDialFunc(proxyAddr string, timeout time.Duration) fasthttp.DialFunc {
return nil
}
if strings.ToLower(u.Scheme) == "socks5" {
return func(addr string) (net.Conn, error) {
dialer, err := proxy.SOCKS5("tcp", u.Host, nil, proxy.Direct)
if err != nil {
@@ -165,6 +164,6 @@ func customDialFunc(proxyAddr string, timeout time.Duration) fasthttp.DialFunc {
return conn, nil
}
} else {
return fasthttpproxy.FasthttpHTTPDialerTimeout(proxyAddr, timeout)
return fasthttpproxy.FasthttpHTTPDialerTimeout(u.Host, timeout)
}
}