Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

HTTP or SOCKS5: A Checklist for Debugging a Proxy Connection

When a proxy works in one client and fails in another, start with the connection settings each client actually uses. A single explicit request gives you a baseline you can compare with the browser or application.

When a proxy works in one client and fails in another, start with the connection settings each client actually uses. A single explicit request gives you a baseline you can compare with the browser or application.

Match the proxy scheme to the endpoint

Check which proxy protocol the provider enabled for the endpoint and which protocols the client accepts. An https:// destination can work through an http:// proxy when the latter supports HTTP CONNECT. An https:// proxy scheme describes TLS on the connection between your client and the proxy. SOCKS5 uses a different handshake, so entering an HTTP proxy host and port in a SOCKS5 field can fail before the destination receives a request.

In curl, socks5:// resolves the destination hostname locally, while socks5h:// asks the proxy to resolve it. Check which behavior your application needs, especially for managed networks with different DNS views. curl proxy options

Make one explicit request

Set PROXY_URL in your local environment to the scheme, host, and port of your authorized test proxy. Use the client's supported credential input if the proxy requires authentication and keep credentials out of screenshots and logs.

curl --noproxy '' --proxy "$PROXY_URL" \
  --fail --silent --show-error --max-time 15 https://api.ipify.org

If this succeeds, compare the result with the expected exit IP. Then reproduce the request in the original client, keeping the proxy scheme and destination fixed.

Read the error before changing the route

Symptom Check first
Connection refused or timed out Proxy hostname, port, and network reachability
HTTP 407 Proxy credentials or the provider's allowlist
Hostname resolution fails Where the client resolves the hostname and whether that DNS view can resolve it
Explicit curl test works but the app fails Whether the app honors the selected proxy and has its own override or bypass setting

If your application needs UDP, check support in both the client and the proxy service. A successful HTTPS request establishes that the HTTPS path works. Test UDP separately.

For additional background, see Global Proxies' proxy protocol comparison and SOCKS5 setup guide.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.