HOW TO USE PROXY POLAND WITH NODE.JS
Node.js code examples for routing HTTP/HTTPS requests, Axios, and fetch through dedicated 4G/5G mobile proxies. Covers Axios proxy config, the native https module with socks-proxy-agent, node-fetch with a proxy agent, IP rotation via the API, and Playwright/Puppeteer proxy setup.
In Node.js, the most reliable proxy setup is usually the least clever one: keep credentials in environment variables, pass the proxy agent into the HTTP client, and log failures without exposing secrets. Proxy Poland endpoints can be used with common libraries for scraping, monitoring, or backend checks where Polish routing matters. Add timeout handling and retries early, because proxy issues are much easier to debug when the script records which request failed and why.
WHY NODE.JS + PROXY POLAND
Node.js is the go-to runtime for server-side automation, API scraping, and headless browser automation. By routing your Node.js requests through Proxy Poland's 4G/5G mobile proxies, you get genuine mobile carrier IPs that reduce anti-bot friction and geo-restrictions.
Node.js setup should be tested with the same proxy protocol, browser profile, target website, and account workflow that will run in production. Check visible IP, DNS route, ASN, session persistence, rotation behavior, and login state before scaling.
SETUP INSTRUCTIONS
- 01
Install HTTP Client Libraries
Install axios or use the built-in https module:
npm install axios # For SOCKS5 support: npm install socks-proxy-agent # For HTTPS proxy: npm install https-proxy-agent
- 02
Get Proxy Credentials
Sign up at proxypoland.com and get your proxy IP, port, username, and password.
- 03
Configure HTTP Proxy with Axios
Route Axios requests through the proxy:
const axios = require('axios'); const response = await axios.get('https://httpbin.org/ip', { proxy: { host: 'proxy-ip', port: 8080, auth: { username: 'your-username', password: 'your-password', }, protocol: 'http', }, }); console.log(response.data); // Should show Polish mobile IP - 04
Configure with Native https Module
Use Node.js built-in https with SOCKS5 agent:
const { SocksProxyAgent } = require('socks-proxy-agent'); const https = require('https'); const agent = new SocksProxyAgent( 'socks5://username:password@proxy-ip:port' ); const options = { hostname: 'httpbin.org', path: '/ip', agent, }; https.get(options, (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => console.log(JSON.parse(data))); }); - 05
Use with node-fetch
Configure node-fetch with a proxy agent:
const fetch = require('node-fetch'); const { HttpsProxyAgent } = require('https-proxy-agent'); const agent = new HttpsProxyAgent( 'http://username:password@proxy-ip:port' ); const response = await fetch('https://httpbin.org/ip', { agent }); const data = await response.json(); console.log(data); - 06
Add IP Rotation
Rotate IP between scraping sessions using the rotation API:
const axios = require('axios'); async function rotateIP() { const response = await axios.get( `http://proxy-ip:port/rotate`, { auth: { username: 'user', password: 'pass' } } ); console.log('New IP:', response.data); return response.data; } // Rotate between scraping tasks await rotateIP(); const result = await axios.get('https://target-site.com', { proxy: proxyConfig }); - 07
Verify Your IP
Check that your requests are routed through the proxy:
const axios = require('axios'); const response = await axios.get('https://httpbin.org/ip', { proxy: { host: 'proxy-ip', port: 8080, auth: { username: 'user', password: 'pass' }, }, }); console.log(response.data.origin); // Should show Polish mobile carrier IP
PRO TIPS
Use https-proxy-agent or socks-proxy-agent for compatibility with most Node.js HTTP clients
Implement retry logic with p-retry or exponential backoff for resilient scraping
Use async/await with Promise.all for concurrent proxy-routed requests
Rotate IPs between scraping batches to avoid IP-based bans
Set realistic User-Agent headers using the user-agents npm package
WORKS GREAT FOR
FAQ
Which Node.js HTTP library works best with mobile proxies?+
Axios is the most popular choice due to its simple proxy configuration. For native usage, https-proxy-agent and socks-proxy-agent work with Node.js built-in modules. got and node-fetch also support proxy agents.
How do I use SOCKS5 proxies in Node.js?+
Install socks-proxy-agent (npm install socks-proxy-agent) and pass it as the agent parameter to your HTTP client. The proxy URL format is: socks5://user:pass@host:port.
How do I handle proxy authentication in Node.js?+
For Axios, set the proxy config object with auth.username and auth.password. For agent-based clients, include credentials in the proxy URL: http://username:password@host:port.
Can I use these proxies with Playwright or Puppeteer in Node.js?+
Yes. Pass --proxy-server=socks5://host:port as a launch argument. Then use page.authenticate() to provide credentials. See the dedicated Puppeteer integration guide.
How do I implement IP rotation in Node.js?+
Call the rotation endpoint (GET /rotate on your proxy) between scraping tasks. The API returns the new IP address. You can automate this with a simple setInterval or trigger it per-request.
How do I use HttpsProxyAgent with Proxy Poland in Node.js?+
const {HttpsProxyAgent} = require('https-proxy-agent'); const agent = new HttpsProxyAgent('http://user:pass@host:port'); fetch(url, {agent}) or https.request({...options, agent}). HttpsProxyAgent handles HTTP CONNECT to upstream HTTPS targets through the Polish carrier IP. For pure HTTP targets, use http-proxy-agent. Both packages are maintained by TooTallNate. Node 18+ native fetch accepts agent via undici dispatcher (different API — see undici Q&A).
What's the axios proxy config for Proxy Poland?+
axios.get(url, {proxy: {host: 'host', port: PORT, auth: {username: 'u', password: 'p'}', protocol: 'http'}'}'). Note: axios's proxy field is HTTP-only; for SOCKS5, use httpsAgent: new SocksProxyAgent('socks5://user:pass@host:port') from socks-proxy-agent and disable proxy: false. Axios sets proxy headers automatically; don't manually set Proxy-Authorization. For high concurrency, configure httpAgent: new http.Agent({keepAlive: true}).
Does got work with SOCKS5 from Proxy Poland?+
got doesn't have built-in SOCKS5 — install socks-proxy-agent and pass it: const {SocksProxyAgent} = require('socks-proxy-agent'); got(url, {agent: {http: agent, https: agent}'}). For HTTP proxy, got accepts agent: {https: new HttpsProxyAgent(url)}. got's retry, hooks, and stream API all work transparently through the proxy. Recommended for scrapers because of its built-in retry-after handling on 429s.
How do I configure undici dispatcher for Proxy Poland?+
Node 18+ undici. const {ProxyAgent, setGlobalDispatcher} = require('undici'); setGlobalDispatcher(new ProxyAgent('http://user:pass@host:port')). Now native fetch routes through the Polish carrier IP. For per-request proxy, pass dispatcher: new ProxyAgent(...) to fetch options. undici doesn't natively support SOCKS5 — for SOCKS5, fall back to socks-proxy-agent with node-fetch or axios. ProxyAgent is HTTP CONNECT only.
How do I implement a rotating proxy pool in Node.js?+
Maintain const agents = proxies.map(p => new HttpsProxyAgent(p)); let i = 0; const next = () => agents[i++ % agents.length]; fetch(url, {agent: next()}). For weighted rotation or sticky-per-host, wrap with a class that tracks recent assignments. Pair with /rotate API calls per agent every N minutes to refresh the underlying Polish carrier IP. p-limit controls concurrency to avoid hammering one proxy with too many parallel requests.
Does Playwright in Node.js bind Proxy Poland per browser context?+
Yes — chromium.launch({proxy: {server: 'http://host:port', username, password}'}) for browser-wide. browser.newContext({proxy: {...}'}) for per-context proxy, which is the killer feature: one Chromium instance, N contexts, each through a different Polish 4G/5G mobile proxy. Each context has its own cookies, storage, and IP. Set N to 5-10 contexts per browser; beyond that, launch more browsers to keep memory under control.
How do I send the rotation API call from Node.js?+
fetch('https://api.proxypoland.com/rotate?token=' + TOKEN, {method: 'POST'}').then(r => r.json()). Native fetch in Node 18+ works without imports. Wait 10-15 seconds for the modem to reconnect: await new Promise(r => setTimeout(r, 12000)). Wrap with p-retry for transient failures. Don't exceed 1 call per 60 seconds per proxy — server-side rate limit returns 429 if you do.