cURL and wget with AeonProxy proxies

Check the gateway from a terminal or use it in shell scripts: cURL works over HTTP and SOCKS5, wget over the HTTP proxy only.

Protocols
cURL: HTTP and SOCKS5. wget: HTTP proxy only, no SOCKS
Authentication
-U / --proxy-user in cURL, --proxy-user and --proxy-password in wget, or the login in the proxy URL
Rotation
Every run is a new connection: a rotating login gets a new IP each time
Works with
Residential and mobile proxies

Before you start

  • cURL (built into macOS, Windows 10 and later, and most Linux systems) or GNU wget. In Windows PowerShell, type curl.exe: plain curl can be an alias of Invoke-WebRequest there.
  • Your proxy login and password from the Residential or Mobile page of the dashboard, and traffic on that product (without traffic the gateway answers 402).
Connection details
Host
gate.aeonproxy.com
Port (HTTP / HTTPS)
7000
Port (SOCKS5)
7001
Login
your proxy login, with targeting keys if you need them: LOGIN-cc-us-sid-abc123
Password
your proxy password

Copy the login and password from the Residential or Mobile page of the dashboard; the generator there also writes ready lines. Key syntax: targeting and sessions.

cURL over the HTTP proxy

-x sets the proxy and -U (long form --proxy-user) the login and password. Always write the port: without one cURL assumes 1080. Use the http:// scheme or none; with https:// cURL starts TLS with the proxy itself, which port 7000 does not speak.

curl -x http://gate.aeonproxy.com:7000 -U "LOGIN-cc-us:PASSWORD" https://api.ipify.org

# the same, with the login in the proxy URL
curl -x "http://LOGIN-cc-us:[email protected]:7000" https://api.ipify.org

SOCKS5

--socks5-hostname hands the site's name to the proxy, so the DNS lookup does not leave from your machine; --socks5 resolves it locally first. In a proxy URL the same pair is socks5h:// and socks5://. The login goes in --proxy-user, as with HTTP.

curl --socks5-hostname gate.aeonproxy.com:7001 --proxy-user "LOGIN-cc-de:PASSWORD" https://api.ipify.org

# the same as a proxy URL
curl -x "socks5h://LOGIN-cc-de:[email protected]:7001" https://api.ipify.org

Rotating or sticky

Each cURL run opens a new connection, so a rotating login gets a new IP every run. Several URLs in one command share a connection, and its IP. A -sid- key keeps one IP across runs until its -ttl- runs out (1 to 60 minutes).

# rotating: every curl run is a new connection, so a new IP
for i in 1 2 3; do curl -sS -x gate.aeonproxy.com:7000 -U "LOGIN-cc-us:PASSWORD" https://api.ipify.org; echo; done

# sticky: the same key keeps one IP for up to 30 minutes
SID=$(openssl rand -hex 4)
for i in 1 2 3; do curl -sS -x gate.aeonproxy.com:7000 -U "LOGIN-cc-us-sid-${SID}-ttl-30:PASSWORD" https://api.ipify.org; echo; done

Proxy environment variables

Both tools read the proxy from the environment, which suits scripts and containers. Write http_proxy in lowercase: cURL ignores HTTP_PROXY, and wget reads lowercase names only. cURL also reads HTTPS_PROXY and ALL_PROXY (which can hold a socks5h:// URL); no_proxy lists hosts to reach directly.

export https_proxy="http://LOGIN-cc-us:[email protected]:7000"
export http_proxy="$https_proxy"

curl https://api.ipify.org
wget -qO- https://api.ipify.org

wget

wget takes the proxy from https_proxy (and http_proxy for http:// links), set in the environment, in ~/.wgetrc or with -e on the command line. The login goes in --proxy-user and --proxy-password, which wget sends with the first request.

wget -qO- -e use_proxy=on -e https_proxy=http://gate.aeonproxy.com:7000 \
  --proxy-user="LOGIN-cc-us" --proxy-password="PASSWORD" https://api.ipify.org

wget has no SOCKS support: a socks5:// proxy URL fails with Unsupported scheme. It also goes direct, from your own IP and without a warning, when the variable for the link's scheme is missing: https_proxy alone does not cover http:// links, and an uppercase HTTPS_PROXY is ignored. For SOCKS5, use cURL or run wget under proxychains.

If it does not work

What you seeWhat to check
curl: (56) CONNECT tunnel failed, response 407The login, the password, or a key in the login that is not in the lists (a misspelled city, for example). Add -v to see the gateway's whole answer.
The same with response 402No traffic left on the product, or the sub-user reached its limit.
The same with response 403The site is blocked by default for every account. curl -v shows the reason in the X-Reason header.
The same with response 502The exit failed. Run the command again: a rotating login gets a new IP on the new connection.
curl: (97) User was rejected by the SOCKS5 serverThe gateway refused the SOCKS5 login. SOCKS5 has one failure code for every cause: check the login, the password, the keys and the traffic left.
A hang, or SSL routines::wrong version numberAn https:// proxy URL. Use http:// for port 7000.
Proxy tunneling failed: Proxy Authentication Required (wget)The --proxy-user and --proxy-password values, and the keys in the login.
wget prints your own IPNo lowercase https_proxy or http_proxy for the scheme of the link.

Questions

Put it in a file. For cURL, a config file with the lines proxy = "http://gate.aeonproxy.com:7000" and proxy-user = "LOGIN:PASSWORD", read with curl -K file. For wget, https_proxy, proxy_user and proxy_password lines in ~/.wgetrc.

Request https://api.ipify.org as above for the IP, or paste the proxy line into the proxy tester, which shows the exit country and the speed.

Proxy questions? Ask support in the live chat.