Home › Guides › cURL

How to test a mobile proxy with cURL

Updated 5 October 2026

Commands for checking, timing and rotating a T-Proxy UK mobile proxy from the command line, and what the common errors mean.

Your connection details are on your proxy’s page and the dashboard: host, HTTP port, SOCKS5 port, username, password and Rotation URL. The host is 187.124.210.93 or 187.124.113.127, depending on which of our servers the proxy is on. Replace HOST, HTTP_PORT, SOCKS_PORT, USERNAME and PASSWORD in the examples with yours.

Your first request

cURL is already installed on macOS, Linux and Windows 10/11. Pass the proxy with -x and the login with -U:

$ curl -x HOST:HTTP_PORT -U USERNAME:PASSWORD https://api.ipify.org

It prints the IP address that websites see. You can also put everything in one proxy URL, which is the form most other tools accept:

$ curl -x http://USERNAME:PASSWORD@HOST:HTTP_PORT https://api.ipify.org

SOCKS5

Use your SOCKS5 port with the socks5h:// scheme. With the h, the proxy looks up domain names itself, so DNS goes over the UK mobile connection too. Plain socks5:// resolves names on your own computer first.

$ curl -x socks5h://USERNAME:PASSWORD@HOST:SOCKS_PORT https://api.ipify.org

Check the IP address

# IPv4 address only
$ curl -x HOST:HTTP_PORT -U USERNAME:PASSWORD https://api.ipify.org

# the address most sites will see: IPv6 if the proxy prefers it
$ curl -x HOST:HTTP_PORT -U USERNAME:PASSWORD https://api64.ipify.org

# response headers only, e.g. to check a site loads
$ curl -I -x HOST:HTTP_PORT -U USERNAME:PASSWORD https://www.bbc.co.uk/

Proxies on SIMs with IPv6 use it first by default. If you need IPv4 everywhere, change the Default IP setting on the proxy page.

Time a request and test speed

-w prints timings once the request finishes. When you use a proxy, connect is the time to reach our server and tls is the time until the HTTPS handshake with the site, through the mobile connection, is done:

$ curl -s -o /dev/null -x HOST:HTTP_PORT -U USERNAME:PASSWORD \
    -w 'connect %{time_connect}s  tls %{time_appconnect}s  first byte %{time_starttransfer}s  total %{time_total}s\n' \
    https://www.google.co.uk/

For a rough download speed, fetch a 25 MB test file and print the average speed in bytes per second (divide by 125,000 for Mbit/s):

$ curl -s -o /dev/null -x HOST:HTTP_PORT -U USERNAME:PASSWORD \
    -w '%{speed_download} bytes/s\n' \
    'https://speed.cloudflare.com/__down?bytes=25000000'

Mobile speeds vary with signal and how busy the local cell is, so run it a few times. 5G plans give more headroom than 4G.

Rotate the IP

Each proxy has its own Rotation URL on its page. Request it to get a new IP address on the same modem. No login is needed, and the URL stays the same for the life of the proxy. Prefix it with time to see how long the rotation took:

$ time curl -s "YOUR_ROTATION_URL"
{"result": "success", ...}

# then check the new address
$ curl -x HOST:HTTP_PORT -U USERNAME:PASSWORD https://api.ipify.org

Use environment variables

cURL, and many other command-line tools, pick up a proxy from environment variables, so you don’t have to repeat -x. On macOS and Linux:

$ export https_proxy="http://USERNAME:PASSWORD@HOST:HTTP_PORT"
$ export http_proxy="$https_proxy"
$ curl https://api.ipify.org

Note http_proxy must be lower case; https_proxy works in either case. Run unset http_proxy https_proxy to stop using the proxy.

On Windows

Windows 10 and 11 include the real cURL as curl.exe. In Windows PowerShell, plain curl is a shortcut to a different command (Invoke-WebRequest) with other options, so type the .exe:

PS> curl.exe -x HOST:HTTP_PORT -U USERNAME:PASSWORD https://api.ipify.org

In Command Prompt, plain curl works. Use double quotes, not single quotes, around URLs and -w formats there, and replace -o /dev/null with -o NUL.

Common errors

cURL saysWhat it means
(56) CONNECT tunnel failed, response 407Wrong username or password on the HTTP port. Copy them again from the proxy page; they change if the proxy was migrated or re-bought.
(97) User was rejected by the SOCKS5 serverWrong username or password on the SOCKS5 port.
(7) Failed to connect … Couldn’t connect to serverNothing answered on that host and port: check both, and that you used the HTTP port with http:// and the SOCKS5 port with socks5h://. Some office and public networks block outgoing connections to unusual ports.
(56) Proxy CONNECT abortedOur server answered, but the modem behind it didn’t. It is usually mid-rotation or restarting: wait a minute and try again. If it lasts, check the proxy page or contact support.
(28) Operation timed outThe request took longer than your -m limit. Try again, or rotate if one IP is consistently slow on a particular site.

Questions

Is the HTTP port only for http:// sites?

No. HTTPS sites are tunnelled through the HTTP port, and the traffic stays encrypted between you and the site.

Do HTTP and SOCKS5 use different logins?

No. The same username and password work on both ports.

Why do api.ipify.org and api64.ipify.org show different addresses?

The first only works over IPv4. The second shows IPv6 when the proxy prefers it, which is the default on SIMs that have IPv6.

Can I rotate on a timer?

You can call the Rotation URL from cron or a scheduled task, as long as rotations are at least a minute apart. Support can also set up timed rotation for you.

More guides

Need a UK mobile proxy?

Real 4G and 5G IPs on EE, O2, Three, Sky and Lyca. Plans from £4 a day.