Axios’s built-in proxy option is often unreliable for HTTPS tunneling. Use https-proxy-agent and set proxy:false. Console credentials; fake placeholders; real code blocks. Not for mainland China.
Copy protocol, host, port, and auth from the console, then put them in the client. Axios’s built-in `proxy` option is often unreliable for HTTPS `CONNECT`. A common pattern is `https-proxy-agent` plus `proxy: false`, so Axios does not wrap the request again or inherit environment proxies.
Python: use a residential proxy in Python. String shapes: Proxy format. Protocol: HTTP / SOCKS5 setup. Commands follow Docs EN quickstart.
ZTProxy sells rotating residential (per GB) and static residential (per IP·month). Examples use fake placeholders—not production hosts. Authorized targets only. Not for mainland China.
What to have ready
| Ready item | Source |
|---|---|
| Protocol, host, port, auth | Console values only (not the fake placeholders) |
| Node.js, `axios`, and `https-proxy-agent` | Your local environment |
| Check URL | An HTTPS target you may access |
| Rotating or static order | Rotating vs static |
Placeholders (not production): host `proxy.example.invalid`, port `10000`, user `USER_EXAMPLE`, password `PASS_EXAMPLE_NOT_REAL`.
Recommended pattern: agent + proxy:false
Keep credentials in environment variables. URL-encode the username and password if they contain `@` or `:`. Point both `httpAgent` and `httpsAgent` at the same agent.
import axios from "axios";
import { HttpsProxyAgent } from "https-proxy-agent";
const user = encodeURIComponent(process.env.ZT_PROXY_USER ?? "USER_EXAMPLE");
const pass = encodeURIComponent(process.env.ZT_PROXY_PASS ?? "PASS_EXAMPLE_NOT_REAL");
const host = process.env.ZT_PROXY_HOST ?? "proxy.example.invalid";
const port = process.env.ZT_PROXY_PORT ?? "10000";
const agent = new HttpsProxyAgent(`http://${user}:${pass}@${host}:${port}`);
const res = await axios.get("https://example.com", {
httpAgent: agent,
httpsAgent: agent,
proxy: false, // do not let Axios’s built-in proxy or env vars also apply
timeout: 30_000,
});
console.log(res.status);
Do not invent country or session fields inside the username. If the console documents those parameters, follow that form; otherwise do not append your own suffixes. Use a SOCKS agent only if the console returns SOCKS5. Do not assume UDP is available.
Sessions and sticky
Reusing one agent may reuse the connection to the gateway. That is not a static IP and not automatically a sticky session. See sticky vs static.
Common issues
| Symptom | Check first |
|---|---|
| 407 | Username, password, URL encoding, and an active order |
| HTTPS still leaves from your IP | `proxy: false` is set; both agents are set |
| Timeout | Protocol and port match the console; you are not using the fake host |
| Wrong region | Order region; DNS is not resolving only locally |
A wider symptom table: 407 and timeout troubleshooting. A CLI first check: test with curl.
Limits
Authorized targets only. This is not a guide to bypassing limits. Prices follow the console (about $0.40/GB rotating, about $0.20/GB for the 100 TB bundle; shared static about $1.50 and dedicated about $5 per IP·month). USDT/USDC available; Visa/Mastercard applying. Not for mainland China.
FAQ
Why not use Axios’s proxy option alone?
It is often unstable for HTTPS tunneling. An agent plus `proxy: false` is easier to reason about and to debug.
Can I use the sample host as-is?
No. Replace it with the values the console returns.
May I add `-country-us` to the username myself?
Do not invent syntax. Use only fields the console or its docs spell out.
Do I need socks-proxy-agent?
Only if the console returns SOCKS5 and you choose a SOCKS client.
Does reusing an agent keep the same IP?
Not necessarily. Connection reuse is not static, and not automatically sticky.
May I use this to bypass login limits?
No. Lawful, authorized targets only.
Should I use Node or Python?
It depends on your runtime. The credential source is the same: the console.
Where are prices confirmed?
In the console and on Pricing.