How to Hide Your IP with Linux curl: Proxy Types, Settings, and Anonymity Tests

This guide explains proxy classifications, shows how to configure HTTP, HTTPS, and SOCKS proxies with Linux curl—including authentication options—and provides step‑by‑step examples and test results to evaluate the anonymity level of each proxy type.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Hide Your IP with Linux curl: Proxy Types, Settings, and Anonymity Tests

Proxy classifications

Proxy servers sit between a browser and the target HTTP server. The most common proxies that support HTTP(S) are:

HTTP proxy – includes transparent, anonymous, and high‑anonymity (elite) variants.

SOCKS proxy – SOCKS4, SOCKS4A, and SOCKS5, which can forward any TCP/UDP traffic and support authentication.

Linux curl proxy options

The curl command offers several parameters to set proxies and their credentials: -x host:port or --proxy protocol://[user:pwd@]host[:port] – select HTTP, HTTPS, SOCKS4, SOCKS4A, or SOCKS5. --socks4 <host[:port]>, --socks4a <host[:port]>, --socks5 <host[:port]> – explicitly choose a SOCKS version (overrides -x).

Authentication flags: --proxy-basic, --proxy-ntlm, --proxy-digest, --proxy-negotiate, --proxy-anyauth. -U user:password or --proxy-user user:password – provide proxy credentials.

Example: configuring an HTTP proxy with curl

# Basic HTTP proxy
curl -x 113.185.19.192:80 http://aiezu.com/test.php
# Using explicit protocol name
curl --proxy 113.185.19.192:80 http://aiezu.com/test.php
# Proxy with basic authentication
curl -x aiezu:[email protected]:80 http://aiezu.com/test.php
# Proxy with NTLM authentication
curl -x 113.185.19.192:80 -U aiezu:123456 --proxy-ntlm http://aiezu.com/test.php

Example: configuring a SOCKS proxy with curl

# SOCKS4 (no authentication)
curl --socks4 122.192.32.76:7280 http://aiezu.com/test.php
# SOCKS4A (no authentication)
curl --socks4a 122.192.32.76:7280 http://aiezu.com/test.php
# SOCKS5 with basic authentication
curl --socks5 122.192.32.76:7280 -U aiezu:123456 http://aiezu.com/test.php

Testing proxy anonymity

Create a simple test.php script on the web server that prints selected $_SERVER entries, e.g.:

<?php
$keys = array(
    'HTTP_USER_AGENT','HTTP_HOST','HTTP_ACCEPT','PATH','SERVER_SIGNATURE',
    'SERVER_SOFTWARE','SERVER_NAME','SERVER_ADDR','SERVER_PORT','DOCUMENT_ROOT',
    'SERVER_ADMIN','SCRIPT_FILENAME','REMOTE_PORT','GATEWAY_INTERFACE',
    'SERVER_PROTOCOL','REQUEST_METHOD','QUERY_STRING','REQUEST_URI','SCRIPT_NAME',
    'PHP_SELF','REQUEST_TIME'
);
$srv = $_SERVER;
foreach ($keys as $k) { unset($srv[$k]); }
print_r($srv);
?>

Access the script with different proxy settings and observe the output:

No proxy : REMOTE_ADDR shows the client’s real IP.

Transparent HTTP proxy : REMOTE_ADDR is the proxy IP, and headers like HTTP_VIA and HTTP_X_FORWARDED_FOR reveal the original IP.

Anonymous HTTP proxy : REMOTE_ADDR is the proxy IP, but no original IP is disclosed; the presence of HTTP_PROXY_CONNECTION indicates proxy usage.

High‑anonymity (elite) HTTP proxy : Only REMOTE_ADDR shows the proxy IP; no headers expose the client’s IP.

SOCKS5 proxy : Behaves like a high‑anonymity proxy, returning only the proxy’s IP.

These results demonstrate how different proxy types affect the visibility of the client’s IP address to the target server.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ProxynetworkHTTPcURLanonymitysocks
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.