Skip to content
Proxy4U

Documentation

Connect to the gateway, choose a location and a session in the username, and manage keys over the API.

Quick start

You need a proxy username and password from the dashboard. Every connection goes to one gateway:

Proxy4U
host:     gw.proxy4u.net
port:     8000
username: customer01-country-us
password: PASSWORD

Send a request through it. The response is the exit IP that websites see:

Terminal
curl -x http://gw.proxy4u.net:8000 \
  -U "customer01-country-us:PASSWORD" \
  https://edge.proxy4u.net

Username parameters

Add parameters to your username, separated by hyphens. Parameter names are not case-sensitive and can come in any order.

Username parameters
customer01-country-us-city-newyork-session-x8k2-ttl-30
country-<cc>

Country code, ISO 3166-1 alpha-2.

Example: country-us, country-gb

city-<name>

City name in lowercase, without spaces or accents.

Example: city-newyork, city-london

session-<id>

Session ID, 1–32 characters from a–z and 0–9. Keeps the same IP.

Example: session-x8k2

ttl-<minutes>

Session lifetime in minutes, 1–60. Default 10.

Example: ttl-30

Unknown or invalid parameters are rejected with status 407 and a clear error code.

Rotating and sticky sessions

  • Rotating: without session, each new connection may use a different device and IP.
  • Sticky: with session-<id>, connections with the same ID use the same device until ttl minutes have passed or the device goes offline. Then you get a new IP.
  • Use a new session ID whenever you want a fresh IP right away.

HTTP and HTTPS

HTTPS goes through an HTTP CONNECT tunnel, so the gateway only sees the target host and encrypted bytes. Plain HTTP URLs are forwarded as absolute-URI requests.

Rotating IP in the United States
curl -x http://gw.proxy4u.net:8000 \
  -U "customer01-country-us:PASSWORD" \
  https://edge.proxy4u.net
Sticky IP in New York for 30 minutes
curl -x http://gw.proxy4u.net:8000 \
  -U "customer01-country-us-city-newyork-session-x8k2-ttl-30:PASSWORD" \
  https://edge.proxy4u.net

SOCKS5

SOCKS5 uses the same host, port and username format, with username and password authentication (RFC 1929). Use socks5h so the hostname is resolved by the exit device and DNS answers match the location.

SOCKS5, sticky IP in Los Angeles
curl -x socks5h://gw.proxy4u.net:8000 \
  -U "customer01-country-us-city-losangeles-session-a1b2:PASSWORD" \
  https://edge.proxy4u.net

IP allowlist and dedicated ports

  • IP allowlist: add your server IPs in the dashboard. Requests from those IPs do not need a password.
  • Dedicated ports: a key can get its own gateway port between 10000 and 60000, for tools that cannot send a username.

Error codes

HTTP and SOCKS5 use the same codes. HTTP clients receive the status below; SOCKS5 clients receive the closest standard reply, and the original code is logged.

407auth_failed

Wrong username or password, IP not on the allowlist, or invalid username parameters.

What to do: Check the credentials and parameters.

402quota_exhausted

Balance, GB quota or daily cap is used up.

What to do: Top up, or wait for the next day on a daily key.

402bundle_exhausted

Your GB bundle is used up; it does not fall back to your balance.

What to do: Buy another GB bundle to continue.

429too_many_connections

Too many simultaneous connections for this user or key.

What to do: Lower the concurrency or ask for a higher limit.

403target_blocked

The destination is blocked by policy, for example a mail port or a private network.

What to do: See the acceptable use policy.

502no_device_available

No device is online for this location right now.

What to do: Retry, or target the country instead of the city.

504upstream_unreachable

The device could not reach the destination in time.

What to do: Retry. The next attempt may use another device.

Limits and blocked destinations

  • Outgoing mail ports 25, 465, 587 are always blocked.
  • Private, local and reserved IP ranges are blocked on the device after the DNS lookup.
  • Some categories, such as government and banking sites, are blocked by default and can be opened after verification.
  • Each user or key has a limit on simultaneous connections. On shared plans at most 4 customers use one exit IP at the same time.

API (key-based)

Draft API

The API below is a draft and may change before launch. A full OpenAPI specification will be published with the dashboard.

The API is for buyers who prefer keys over per-GB credentials, and for resellers. Authenticate with an API key from the dashboard, sent as a Bearer token. Times are Unix epoch seconds, and error codes are fixed English strings.

Base URL: https://api.proxy4u.net

GET /v1/locations

Countries, cities and providers with devices online, with counts.

POST /v1/keys

Buy keys: plan, period, quantity and location. Send an Idempotency-Key header so a retried request is never charged twice.

GET /v1/keys?customer=

List one customer's keys (for resellers).

GET /v1/proxy/current?key=

The proxy a key is using now: exit IP, HTTP and SOCKS5 strings, seconds left, seconds until you may rotate, and key expiry. Issues a new IP automatically when the old one has expired.

GET /v1/proxy/new?key=&city=&isp=

Get a new IP, within the plan's rotation interval. Optional city and provider filters.

POST /v1/keys/{key}/renew

Extend a key.

GET /v1/usage

Traffic and IP rotations per day.

Current proxy for a key
curl -H "Authorization: Bearer $API_KEY" \
  "https://api.proxy4u.net/v1/proxy/current?key=KEY"
Example response
{
  "ip": "203.0.113.45",
  "http": "gw.proxy4u.net:10001:k7f3a:PASSWORD",
  "socks5": "gw.proxy4u.net:10001:k7f3a:PASSWORD",
  "expires_in": 1260,
  "rotate_in": 45,
  "key_expires_at": 1767225600
}

Field names are illustrative until the OpenAPI specification is published.