🎨 Format files

This commit is contained in:
2025-04-03 05:01:22 +04:00
parent e80ae9ab24
commit 42d5617e3f
16 changed files with 55 additions and 49 deletions

View File

@ -72,11 +72,12 @@ func getClients(
func getDialFunc(proxy *url.URL, timeout time.Duration) (fasthttp.DialFunc, error) {
var dialer fasthttp.DialFunc
if proxy.Scheme == "socks5" || proxy.Scheme == "socks5h" {
switch proxy.Scheme {
case "socks5", "socks5h":
dialer = fasthttpproxy.FasthttpSocksDialerDualStack(proxy.String())
} else if proxy.Scheme == "http" {
case "http":
dialer = fasthttpproxy.FasthttpHTTPDialerDualStackTimeout(proxy.String(), timeout)
} else {
default:
return nil, errors.New("unsupported proxy scheme")
}
return dialer, nil