Using SOCKS5 for your scraping tasks

SOCKS5 enables more flexibility to collect data from targets, as well as using more underlines protocols, and without limitation on the port number used by the proxy peer towards the target.

Do you really need SOCKS5?

Our HTTP and HTTPS proxy solutions are usually the best fit for scraping websites, offfering lowest cost and highest performance. However, if the the task still requires SOCKS5 toolip can provide quality proxies around the globe.

Supported Proxy types

SOCKS5 proxy connections are currently supported only on ISP and Datacenter proxies.

Using SOCKS5 over toolip Residential proxy networks requires toolip compliance approval.

SOCKS5 Port configuration

toolip uses port 31115 for SOCKS5
When using SOCKS5 make sure to use proxy.toolip.io:31115 and not the standard ports 31111-31114 used for HTTP and HTTPS protocols.

OCKS5 targeting with toolip

toolip supports only hostnames (domain names) for SOCKS5 proxies

Per our compliance regulation, we allow SOCKS5 requests only with hostnames/domain names relayed as target. Requests sent with explicit IPs or local IP resolution, are blocked.

Hence, configure your code, client or calling application to:

  1. Use domain name as target
  2. Resolve DNS remotely and not locally

Adhering to those rules will ensure the request to get to the target domain IP, thru our proxy peer.

Using curl with SOCKS5

Use socks5h://proxy.toolip.io:31115 when issuing curl requests

To use curl with toolip SOCKS5 proxies, you have to explicitly:

  1. Add -x to your command line parameters
  2. Use SOCKS5h protocol for remote DNS lookup
  3. Use proxy address as proxy.toolip.io:31115
  4. Provide toolip proxy zone credentials

Requests which do not comply with all the above are blocked.

Examples curl command:

curl -i -x socks5h://proxy.toolip.io:31115 --proxy-user [USERNAME]:[PASSWORD] "https://toolip.io/welcome.txt"

Troubleshooting with curl

We recommend using curl to troubleshoot your SOCKS5 requests, and adding curl options -i or -v for printing header fields. Look for x-brd-error, x-brd-err-code and x-brd-err-msg for elaborated error messages sent by toolip proxy networks.

SOCKS5 Authentication configuration

toolip must receive proxy zone credentials to access SOCKS5 proxy

The authentication is done also similarly to HTTP and HTTPS by relaying the user and password for the proxy access.

Some tools or utilities will give you place to input the credentials and port separately as parameters, as seen in the control panel, and some will require you to provide a url with the credentials delimited single parameter: userName:password@proxy.toolip.io:31115.

Difference between SOCKS5 and SOCKS5h

The difference between SOCKS5 and SOCKS5h lies in how they handle DNS (Domain Name System) resolution:

  1. SOCKS5: In the standard SOCKS5 proxy, the client resolves the DNS. This means that the domain name (e.g., example.com) is resolved into an IP address before it is passed through the proxy. The proxy then routes traffic to the resolved IP address.

  2. SOCKS5h: The “h” stands for “hostname.” In this case, the proxy server resolves the DNS. The client sends the domain name (not the IP address) to the proxy server, which resolves it and forwards the request. This is useful if you want to hide the destination domain names from the client’s network.

To summarize:

  • SOCKS5: DNS resolution happens on the client-side.
  • SOCKS5h: DNS resolution happens on the proxy-side.

toolip supports proxy side SOCKS5h - choose what works best for your requirements.