优化socks5代理

This commit is contained in:
Yun
2024-12-11 19:24:49 +08:00
parent 2cf94d88ab
commit 6387f372c4
+5 -1
View File
@@ -79,6 +79,10 @@ func (c *Curlx) WithProxySocks5(address string) error {
baseDialer := &net.Dialer{
// Timeout: 180 * time.Second,
// KeepAlive: 180 * time.Second,
Resolver: &net.Resolver{
PreferGo: true,
Dial: c.transport.DialContext,
},
}
dialSocksProxy, err := proxy.SOCKS5("tcp", address, nil, baseDialer)
if err != nil {
@@ -94,7 +98,7 @@ func (c *Curlx) WithProxySocks5(address string) error {
}
/**
* 使用HTTP代理
* 使用HTTP/HTTPS代理
* @param proxyAddr "https://proxyserver:port"
*/
func (c *Curlx) WithProxyHttp(proxyAddr string) error {