mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-08-28 19:56:41 +08:00
fix: update SOCKS5 proxy dialer implementation for consistency
This commit is contained in:
@@ -43,11 +43,10 @@ func NewProxyHTTPClient(proxyUrl string) (*http.Client, error) {
|
|||||||
},
|
},
|
||||||
}, nil
|
}, nil
|
||||||
case "socks5":
|
case "socks5":
|
||||||
dialer, err := proxy.SOCKS5("tcp", u.Host, nil, proxy.Direct)
|
dialer, err := proxy.FromURL(u, proxy.Direct)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &http.Client{
|
return &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user