Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use WeProxy with Python

WeProxy — Python proxy example

Website Integrations

Minimal requests example: print your exit IP through the WeProxy HTTP proxy gateway.

Requirements

Install

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env

Export credentials (this sample reads process environment, not the .env file directly):

export WEPROXY_USER="your-user"
export WEPROXY_PASS="your-pass"

PowerShell:

$env:WEPROXY_USER="your-user"
$env:WEPROXY_PASS="your-pass"

Gateway defaults:

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

Run

python src/check_ip.py

Code

import requests

proxy = "http://USER:PASSWORD@gw.weproxy.com.tr:8989"
proxies = {"http": proxy, "https": proxy}

print(requests.get("https://api.ipify.org", proxies=proxies, timeout=30).text)

Full script: src/check_ip.py.

Residential vs datacenter

Use panel credentials for the product you purchased — e.g. rotating residential or rotating datacenter. Gateway host/port stay the same.

SOCKS5 requires a SOCKS-capable package and typically requests[socks]; this sample uses HTTP proxy mode.

Links

Suggested GitHub topics

python · requests · proxy · residential-proxy · socks5 · http-proxy

License

MIT — see LICENSE.

About

Use WeProxy HTTP proxies with Python requests

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages