How to Test a Proxy Connection

Published

Resolve the proxy hostname

Start on the machine that runs the failing application. Get the hostname, port and proxy type from the operator. In these examples, replace gateway.example and 8080 with the values for your approved HTTP proxy. Use the same network or VPN as the application.

Resolve-DnsName -Name gateway.example

An address in the answer tells you that this machine can resolve the gateway name. Check all returned addresses if your setup supports IPv4 and IPv6. If the lookup fails, confirm the spelling and whether the name is available only through your organization’s resolver. In an application or container, run the lookup from that application’s environment when possible. PowerShell DNS lookup reference.

Check whether the proxy port accepts TCP

Test-NetConnection -ComputerName gateway.example -Port 8080 -InformationLevel Detailed

Check RemoteAddress, RemotePort and TcpTestSucceeded. A successful TCP handshake confirms that a service accepted a connection on the selected address and port. The next step checks whether it speaks the proxy protocol and can reach your destination. If the TCP check fails, confirm the port and required network with the proxy operator. Microsoft TCP connectivity example.

Request one HTTPS URL through the proxy

Choose an HTTPS URL you are permitted to test. The command below uses the TestMyProxies IP endpoint. It also prints the response to the tunnel request and the HTTP status from the destination. Use curl.exe in Windows PowerShell. If your approved endpoint uses HTTPS to reach the proxy itself, use its https:// proxy address. For SOCKS5, use the separate cURL SOCKS5 example and read the SOCKS handshake result.

curl --disable --noproxy "localhost" --proxy "http://gateway.example:8080" --silent --show-error --connect-timeout 5 --max-time 15 --write-out "\nCONNECT %{http_connect} | Target %{http_code}\n" "https://testmyproxies.com/api/my-ip"
  • CONNECT 200 and Target 200. The proxy opened the tunnel and the destination replied. Compare the returned ip with the exit address or range you expect.
  • CONNECT 407. The TCP connection worked. Check which authentication scheme the proxy requested and use the approved proxy credentials. Identify which endpoint asked for credentials.
  • CONNECT 200 and Target 000. The proxy accepted CONNECT, but cURL received no HTTP status from the destination. Read the cURL error to see whether TLS, the connection or a timeout ended the request.
  • CONNECT 000. cURL recorded no HTTP response to CONNECT. Check the command’s error output and verify the host, port and proxy scheme. Look up the cURL exit code.

Confirm the result in TestMyProxies

For a gateway that is only reachable on a LAN or VPN, choose a test that can reach the private proxy.

Run a single proxy through the default IP check and compare its result with the terminal test. The online checker connects from a different machine. If one test works and the other returns an authentication or connection error, check which source IPs the provider allows and whether the endpoint is reachable from both networks. For a destination-specific problem, test a verified URL you control and compare the status for that same URL.

All proxy testing guides · Open the proxy tester