Skip to content

Commit

Permalink
refs #104: added handling for socks5h proxies;
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanfinn committed Apr 10, 2024
1 parent 59dd713 commit 311f878
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func newConnectDialer(proxyUrlStr string, timeout time.Duration, localAddr *net.
if proxyUrl.Port() == "" {
proxyUrl.Host = net.JoinHostPort(proxyUrl.Host, "443")
}
case "socks5":
case "socks5", "socks5h":
return handleSocks5ProxyDialer(proxyUrl, localAddr)
case "":
return nil, errors.New("specify scheme explicitly (https://)")
Expand Down
2 changes: 1 addition & 1 deletion example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func rotateProxiesOnClient() {
options := []tls_client.HttpClientOption{
tls_client.WithTimeoutSeconds(30),
tls_client.WithClientProfile(profiles.Chrome_107),
tls_client.WithProxyUrl("http://user:pass@host:port"),
tls_client.WithProxyUrl("http://user:pass@host:port"), // you can also use socks5://user:pass@host:port or socks5h://user:pass@host:port
}

client, err := tls_client.NewHttpClient(tls_client.NewNoopLogger(), options...)
Expand Down

0 comments on commit 311f878

Please sign in to comment.