Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use WeProxy with Node.js

WeProxy — Node.js proxy example

Website Integrations

Minimal example: send an HTTPS request through the WeProxy HTTP proxy gateway and print your exit IP.

Requirements

Install

npm install

Copy env defaults:

cp .env.example .env

Edit .env with your panel username and password. Gateway defaults:

Host: gw.weproxy.com.tr
Port: 8989

Run

Export env vars, then:

npm run check-ip

Example (PowerShell):

$env:WEPROXY_USER="your-user"
$env:WEPROXY_PASS="your-pass"
npm run check-ip

Code

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: src/check-ip.js.

Residential vs datacenter

Use the username/package from the panel for the product you purchased — for example rotating residential or rotating datacenter. The gateway host and port stay the same.

SOCKS5: use it only when your package enables SOCKS in the panel; this example uses HTTP proxy mode.

Links

Suggested GitHub topics

nodejs · proxy · https-proxy-agent · javascript · residential-proxy · socks5 · http-proxy

License

MIT — see LICENSE.

About

Use WeProxy HTTP proxies with Node.js (https-proxy-agent example)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages