Minimal, runnable example: route HTTPS traffic through the WeProxy HTTP proxy gateway from Node.js using https-proxy-agent, then print your exit IP.
Node’s built-in https client accepts an agent. HttpsProxyAgent turns your WeProxy URL into that agent so every request leaves through gw.weproxy.com.tr:8989.
Works for:
- Scrapers and bots in Node
- Backend jobs that must egress via residential / DC packages
- Quick connectivity checks in CI (with secrets in env, never in git)
- Node.js 18+
- Credentials from my.we1.town
- Network access to the WeProxy gateway
npm install
cp .env.example .envSet real values (do not commit .env):
WEPROXY_HOST=gw.weproxy.com.tr
WEPROXY_PORT=8989
WEPROXY_USER=your-panel-user
WEPROXY_PASS=your-panel-pass
Or one shot:
WEPROXY_URL=http://USER:PASSWORD@gw.weproxy.com.tr:8989
npm run check-ipPowerShell:
$env:WEPROXY_USER="your-user"
$env:WEPROXY_PASS="your-pass"
npm run check-ipExpected output: Exit IP: x.x.x.x
import https from 'node:https'
import { HttpsProxyAgent } from 'https-proxy-agent'
const agent = new HttpsProxyAgent('http://USER:PASSWORD@gw.weproxy.com.tr:8989')
https.get('https://api.ipify.org', { agent }, (res) => {
let body = ''
res.on('data', (chunk) => (body += chunk))
res.on('end', () => console.log(body))
})Full script with env parsing and errors: src/check-ip.js.
The code path is identical. Switch products by using the credentials for the package you bought:
SOCKS5 needs a SOCKS-capable agent and a package that enables SOCKS — this repo stays on HTTP proxy mode.
| Symptom | What to check |
|---|---|
407 / auth errors |
Username/password from panel; URL-encoding special characters |
| Timeouts | Firewall, wrong host/port, package suspended |
| Wrong country | Panel targeting / package — not this sample’s job |
| Works in cURL, fails in Node | Confirm HttpsProxyAgent wraps the same URL as cURL -x |
Manual cURL baseline:
curl -x http://USER:PASSWORD@gw.weproxy.com.tr:8989 https://api.ipify.orgnodejs-proxy/
├── assets/banner.png
├── src/check-ip.js
├── .env.example
├── package.json
└── README.md
MIT — see LICENSE.
