Skip to main content
All CollectionsTroubleshooting
How to Test a Proxy on Linux
How to Test a Proxy on Linux

Ensure your internet traffic is routed through the proxy correctly on Linux with this simple, step-by-step guide to test a proxy.

A
Written by Analyce Nazario
Updated over a month ago

Why Test Your Proxy?

  • Verify if the proxy is working: Make sure your connection goes through the proxy server.

  • Check your IP address: See if your public IP has changed to the proxy server’s IP.

  • Troubleshoot issues: Solve any connection problems related to the proxy.

Step-by-Step Guide to Test a Proxy on Linux

Method 1: Testing a Proxy Using curl

You can test your proxy directly from the terminal using the curl command. Follow these steps:

  1. Open the Terminal:

    • On your Linux system, open the terminal.

  2. Run the curl Command:

    • Type the following command, replacing the placeholder values with your proxy details:

    curl -x <proxy_ip>:<proxy_port> -U <username>:<password> http://www.example.com

    Example:

    curl -x 65.111.0.107:9090 -U hak_sivN21R:XaW4fdkBpgl0uhz http://www.example.com

    Explanation:

    • -x <proxy_ip>:<proxy_port>: Specifies the proxy IP and port (e.g., 65.111.0.107:9090).

    • -U <username>:<password>: Provides the proxy username and password for authentication (if required).

    • http://www.example.com: The website you're trying to reach through the proxy.

  3. Check the Output:

    • If the proxy is working, the command will return the content of the webpage (example.com in this case). If the proxy is not working, you’ll see an error message.


Method 2: Using Environment Variables for Proxy

You can also set your proxy as a system-wide environment variable. This method applies the proxy to all HTTP requests made from the terminal.

  1. Set the Proxy as an Environment Variable:

    • Enter the following command to set the proxy for HTTP traffic:

    export http_proxy="http://<username>:<password>@<proxy_ip>:<proxy_port>"

    Example:

    export http_proxy="http://hak_sivN21R:[email protected]:9090"
  2. Test the Proxy:

    • Now, use the curl command without the proxy flags to test if the proxy is working:

    curl http://www.example.com
    • If the proxy is set correctly, the output will show the webpage content from example.com.

  3. Unset the Proxy (optional):

    • If you no longer want to use the proxy, you can remove it with this command:

    unset http_proxy



Troubleshooting Common Proxy Issues

  • Incorrect proxy details: Double-check the IP, port, username, and password.

  • Proxy not responding: Try a different site to confirm if the issue is with the proxy or the site.

  • Proxy not showing in browser: Clear your browser cache and try again.

Testing a proxy on different devices is simple and quick. By following these steps, you can confirm that your proxy is working and that your internet traffic is securely routed.

If you have any questions or problems with your proxy setup, you can reach our support team through the chat on our website or on our Discord server. We're here to help!

Did this answer your question?