- Host
- gw.prokso.com
- Port
- 823 HTTP · 824 SOCKS5 - new IP per request · 10000–20000 sticky session, HTTP(S) and SOCKS5
- Username and password
- in your dashboard, on the plan page
Your dashboard generates ready-made lines in the format you need: choose the country, IP type and protocol.
- Generator format - protocol://username:password@host:port, the line goes into HttpsProxyAgent unchanged
- proxy: false turns off axios's own proxy and environment variables, only the agent works
- The correct result - the ip field in the check.mjs output with the proxy address, not yours
Video transcript
Prokso proxies in Node.js.
First, get your proxy details from the dashboard: host, port, username and password. They are on the plan page, in the Access block.
In Node.js, create a proxy agent from the https-proxy-agent package and pass it to axios.
Run the example: the output should show the proxy IP, not yours. On port 823, every run gets a new address.
The full guide with examples is on the Prokso website.
A step-by-step guide to connecting Prokso proxies in Node.js. It takes a few minutes.
Step 1. Build the proxy URL for HttpsProxyAgent and axios
In this guide requests go through axios, and the proxy is connected with an agent from the https-proxy-agent package. The agent takes the proxy address as one line, so in the dashboard generator choose the protocol://username:password@host:port format. You get a line like http://USERNAME:PASSWORD@gw.prokso.com:823, which goes into the code unchanged.
axios also has its own proxy option with fields for the host, port and username, and it reads the http_proxy and https_proxy variables as well. To keep this from mixing with the agent, the examples use proxy: false: according to the axios documentation, this disables the proxy and ignores environment variables, so only the agent works.
Choose the mode in the generator for the task: "Rotating (new IP per request)" gives port 823, "Sticky session" gives ports 10000-20000 with one address for 1 to 120 minutes. SOCKS5 needs a different agent, socks-proxy-agent, and the socks5:// scheme. If the password contains @ or :, encode the username and password with encodeURIComponent(), otherwise the URL will be parsed incorrectly.

Step 2. Install the packages
You'll need axios and https-proxy-agent: npm i axios https-proxy-agent.
Step 3. Create a proxy agent
Pass the proxy URL to HttpsProxyAgent and attach it to the request. Keep proxy: false so axios doesn't apply its own settings.
// npm i axios https-proxy-agent
import axios from "axios";
import { HttpsProxyAgent } from "https-proxy-agent";
const agent = new HttpsProxyAgent("http://USERNAME:PASSWORD@gw.prokso.com:823");
const { data } = await axios.get("https://api.ipify.org?format=json", { httpsAgent: agent, proxy: false });
console.log(data);Save it as check.mjs and run node check.mjs.
Step 4. Switch between modes
Port 823 gives a new IP per request, 10000-20000 a stable IP for a session. For SOCKS5 use the socks-proxy-agent package and port 824 (rotation) or the same sticky 10000-20000 port.
Step 5. Run check.mjs and look at the ip field in the response
After node check.mjs the console shows an object with an ip field: this is the address the request used to reach https://api.ipify.org. It should differ from your computer's address. If it matches, axios sent the request directly: check that the agent is passed in httpsAgent for https addresses.
Run the script again. On port 823 the address will change, on a sticky port it will stay the same until the session duration runs out. If the script crashes with an error instead of an object, its code is in the "What the errors mean" section below.
The My IP page in a browser will show nothing useful here: the browser does not use the script's agent and goes direct.

One agent for the whole app
Create the proxy agent once and reuse it in all requests. A new agent for every request opens a new connection to the proxy, and the script runs slower. The most convenient way is to build an axios instance with the settings you need:
import axios from "axios";
import { HttpsProxyAgent } from "https-proxy-agent";
const agent = new HttpsProxyAgent("http://USERNAME:PASSWORD@gw.prokso.com:823");
// one client for the whole app: proxy, timeout, no built-in axios proxy
const http = axios.create({ httpAgent: agent, httpsAgent: agent, proxy: false, timeout: 30000 });
const { data } = await http.get("https://prokso.com/ip");
console.log(data);Set the timeout explicitly: by default axios waits for a response forever, and a single hung request will stop the queue.
What the errors mean
- Response 407. The proxy did not accept the username or password. Check the string and the remaining traffic on your plan.
- ECONNREFUSED. Nothing is responding on the host and port you entered: there is a typo in the address or the port.
- ETIMEDOUT or ECONNRESET. The connection dropped or was never established. Retry the request: on port 823 it will go out from a new IP.
- The request went out from your own IP. Either
proxy: falseis missing and axios applied its own settings, or the agent was not passed for the right protocol.
Codes 403 and 429 come from the site, not from the proxy. What to do about them is described on the proxy error codes page.
Parallel requests
Promise.all starts all the requests at once. With hundreds of addresses, this overloads both the site and your script. Limit the number of simultaneous requests with a queue: ten to twenty is usually enough, and if you get 429 responses, lower it.
If the proxy does not work
FAQ
Does Node.js read the HTTP_PROXY variables?
The built-in modules do not read them by default. It is more reliable to pass the proxy explicitly through an agent, as in the example.
What if the plan password contains @ or a colon?
Wrap the username and password in encodeURIComponent() when you build the proxy address for the agent.
How do I keep one IP for a series of requests?
Replace port 823 with a sticky port from the 10000-20000 range: all requests through it will go out from one IP for as long as the session lasts.
Was this guide helpful?
Thanks for your feedback!
Sorry about that. Tell us which step you got stuck on and we will help.