Ports

Each proxy has a public host:port on our cloud router. Two layouts:

ModeWhat it means
shared (default)One port speaks HTTP, HTTPS (CONNECT) and SOCKS5. http_port and socks5_port are the same number.
splitTwo ports: http_port speaks HTTP/HTTPS only, socks5_port speaks SOCKS5 only.

The ready-made strings in GET /proxies/{id} (users[].http, users[].socks5) always use the right port. You can pick the port numbers yourself from the cloud router's free range (range, 30000–30999 today). A port another proxy uses — yours or another customer's — cannot be taken.

Warning

Changing a port or the mode changes the proxy's address. Every client still using the old address stops working within about 10 seconds. Each change is written to the activity log.

In split mode each port refuses the other protocol once the box runs agent 1.3.0 or newer (a SOCKS5 client on the HTTP port is refused; an HTTP client on the SOCKS5 port gets 400). With an older agent both ports accept both.

Get the ports

GET /proxies/{id}/ports

Ability: read

curl
Python
Node.js
PHP
curl 'https://proxykite.com/api/v1/proxies/7/ports' \
  -H "Authorization: Bearer $HYP_TOKEN" \
  -H 'Accept: application/json'

Response 200

{"data": {"mode": "split", "http_port": 30007, "socks5_port": 30544, "host": "152.67.6.160",
  "range": {"min": 30000, "max": 30999}}}

Change the ports

PUT /proxies/{id}/ports

Ability: manage · Who: the account owner or a team admin. At most 20 changes per minute.

Body fieldType
modestringrequired — shared or split
http_portintegeroptional — new HTTP port (in shared mode: the one port). Leave it out to keep the current one
socks5_portintegeroptional, split only — new SOCKS5 port. Leave it out to keep the current one, or to get a random free port when switching to split
curl
Python
Node.js
PHP
curl -X PUT 'https://proxykite.com/api/v1/proxies/7/ports' \
  -H "Authorization: Bearer $HYP_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"mode":"split","socks5_port":30544}'

Response 200 — the ports object as in Get the ports.

422 validation_failed with fields.http_port / fields.socks5_port when a port is outside range, already used, or both ports are the same; fields.socks5_port "No free port left on this cloud router" when the range is full.

Pick a free port

GET /proxies/{id}/ports/free

Ability: manage · Returns one random free port of this proxy's cloud router (null when the range is full). It is not reserved — use it in PUT /proxies/{id}/ports right away.

curl
Python
Node.js
PHP
curl 'https://proxykite.com/api/v1/proxies/7/ports/free' \
  -H "Authorization: Bearer $HYP_TOKEN" \
  -H 'Accept: application/json'

Response 200

{"data": {"port": 30544}}