# How to Test a Proxy on Linux (curl, SOCKS5) | Core Proxies

Source: https://coreproxies.com/help/article/how-to-test-a-proxy-on-linux/

Last updated: 2026-11-27

## How to Test a Proxy on Linux

Five curl commands tell you whether a proxy accepts your credentials, which IP it exits from, whether rotation and sticky sessions behave as expected, and how long a request takes.

November 27, 2026 · 4 min read · Linux

### Before you start

You need curl, which most distributions install by default. Check with `curl --version`; on Debian or Ubuntu install it with `sudo apt install curl`, on Fedora or RHEL with `sudo dnf install curl`.

The commands contain four placeholders: `HOST`, `PORT`, `USERNAME` and `PASSWORD`. Replace them with the values from your dashboard. The rotation and session checks in step 3 describe Residential, Unlimited Residential and Rotating Mobile, where HTTP, HTTPS and SOCKS5 use the same host and port. On Datacenter and ISP orders, choose rotating, sticky or static in the Proxy generator of your order and copy the generated lines.

First, note your own address so you can tell the proxy apart from a direct connection. In a browser, the [My IP tool](https://coreproxies.com/tools/my-ip/) shows the same address together with its country:

```bash
curl "https://api.ipify.org?format=json"
```

### 1. Check the exit IP

The `-x` option sets the proxy and `-U` passes the proxy credentials:

```bash
curl -x "http://HOST:PORT" \
  -U "USERNAME:PASSWORD" \
  "https://api.ipify.org?format=json"
```

A working proxy answers with an address that is not your own, for example `{"ip":"203.0.113.24"}`.

If the result is not what you expect, add `-v`. curl then prints the `CONNECT` request it sends to the proxy and the status line the proxy returns, which is where authentication and connection errors show up.

### 2. Test SOCKS5

For SOCKS5, put the credentials in the proxy URL and use the `socks5h` scheme. The `h` makes the proxy resolve the hostname, so DNS lookups do not leave from your machine:

```bash
curl -x "socks5h://USERNAME:PASSWORD@HOST:PORT" \
  "https://api.ipify.org?format=json"
```

### 3. Confirm rotation and sticky sessions

Run the request several times in a loop with the plain username. Every curl call opens a new connection, and on Residential and Rotating Mobile every new connection gets a new IP, so the lines should differ:

```bash
for i in 1 2 3 4 5; do
  curl -s -x "http://HOST:PORT" \
    -U "USERNAME:PASSWORD" \
    "https://api.ipify.org"
  echo
done
```

Now switch to a sticky session. Add a session number and a TTL in seconds to the username: `USERNAME-session-482913-ttl-600` keeps one IP for 600 seconds. Pick your own number and use digits only. On Residential and Unlimited Residential a sticky session lasts up to 24 hours, which is a TTL of 86400. The loop should print the same address five times:

```bash
for i in 1 2 3 4 5; do
  curl -s -x "http://HOST:PORT" \
    -U "USERNAME-session-482913-ttl-600:PASSWORD" \
    "https://api.ipify.org"
  echo
done
```

Change the session number to get a different IP. Residential IPs connect to websites on ports 80 and 443 only, so run these checks against an `http://` or `https://` address on its default port.

### 4. Measure response time

curl can report the HTTP status and timings without printing the body. `time_connect` is the time to reach the proxy, and `time_total` covers the whole request through it:

```bash
curl -s -o /dev/null \
  -x "http://HOST:PORT" \
  -U "USERNAME:PASSWORD" \
  -w "status=%{http_code} connect=%{time_connect}s total=%{time_total}s\n" \
  "https://api.ipify.org"
```

Run it a few times and against the site you plan to work with; a single measurement says little. Timing depends on the proxy type, the exit location and the target server.

### 5. Use the proxy for a whole shell session

curl, wget, pip, git and many other tools read the proxy from environment variables. Export them once and every command in that shell uses the proxy:

```bash
export http_proxy="http://USERNAME:PASSWORD@HOST:PORT"
export https_proxy="$http_proxy"

curl "https://api.ipify.org?format=json"
wget -qO- "https://api.ipify.org"

# Stop using the proxy
unset http_proxy https_proxy
```

If your password contains characters such as `@`, `:` or `/`, percent-encode them in the URL form (`@` becomes `%40`), or use the separate `-U` option, which needs no encoding. Commands typed in a shell end up in its history file, so prefer a script or an environment file with restricted permissions for anything permanent.

### Common errors

| What curl reports | Likely cause | What to check |
| --- | --- | --- |
| HTTP 407 from the proxy | Credentials rejected | Username and password copied in full; the session suffix spelled `-session-…-ttl-…`; the plan is still active |
| Could not resolve proxy | Hostname typo or local DNS problem | The host from your dashboard, then `getent hosts` followed by that host |
| Connection refused or timed out | Wrong port, or outbound traffic blocked | The port shown in your dashboard; firewall rules on your server or network |
| Same IP as without the proxy | The request did not go through the proxy | The `-x` option is present; `no_proxy` does not list the target |
| IP changes during a sticky session | Session expired or the number changed | The TTL covers your task; every request uses the same session number |

If a command still fails, send the full `curl -v` output, with the password removed, to [info@coreproxies.com](mailto:info@coreproxies.com). More answers are on the [technical section of the FAQ](https://coreproxies.com/faq/#technical).

### Need a proxy to test?

Datacenter plans start from €15 / month and Residential packages from 5 GB for €11.50. Prices exclude VAT.

[Get started](https://coreproxies.com/register/) · [See pricing](https://coreproxies.com/pricing/)

Next article

[How to Test a Proxy on Windows →](https://coreproxies.com/help/article/how-to-test-a-proxy-on-windows/)
