imroc / req

Simple Go HTTP client with Black Magic
https://req.cool
MIT License
4.11k stars 334 forks source link

Will it support socks5h #346

Open feeops opened 2 months ago

feeops commented 2 months ago

The main difference between socks5 and socks5h lies in how they handle hostname resolution.

Socks5: This is the standard SOCKS5 protocol, which is used for proxying network connections. It supports TCP or UDP connections and provides enhanced security features. However, it does not inherently support hostname resolution, meaning that the client is responsible for resolving the hostname to an IP address before connecting to the proxy server. This can be a limitation in scenarios where the client needs to access resources using domain names rather than IP addresses.

Socks5h: The h in socks5h stands for "hostname," indicating that this version of the SOCKS5 protocol supports hostname resolution. Unlike the standard Socks5, the socks5h proxy can resolve hostnames, making it suitable for scenarios requiring domain-specific access. This feature enhances flexibility and accuracy in data acquisition, especially in tasks that involve data collection based on domain names

In summary, if your application or use case requires accessing resources using domain names, socks5h would be the more appropriate choice due to its ability to resolve hostnames. On the other hand, if your needs are straightforward and do not involve domain name resolution, the standard socks5 protocol should suffice.

ManuelReschke commented 1 month ago

i think this is already implemented https://req.cool/docs/tutorial/proxy/

Socks5: client.SetProxyURL("socks5://myproxy:1080")

Socks5h: client.SetProxyURL("socks5h://myproxy:1080")