Authentication
WeProxies uses username/password authentication for all proxy connections. This guide explains the authentication system and username format options.
Basic Authentication
Every request must include your credentials:
Username: your-proxy-username
Password: your-proxy-password
Finding Your Credentials
- Go to Dashboard → Proxies
- Click on your active subscription
- Your credentials are displayed in the Connection Details section
Username Format
WeProxies uses a flexible username format that allows you to configure proxy behavior directly in the username:
USERNAME[-option-value][-option-value]...
Available Options
| Option | Values | Description |
|---|---|---|
country | 2-letter ISO code | Target a specific country |
session | Any string | Create a sticky session |
state | State code | Target US state (when country=US) |
city | City name | Target specific city |
Examples
# Basic - rotating residential IP
wp_abc123xyz:password
# Country targeting - US IP
wp_abc123xyz-country-US:password
# Sticky session - same IP for 10 minutes
wp_abc123xyz-country-US-session-user123:password
# US state targeting
wp_abc123xyz-country-US-state-CA:password
# City targeting
wp_abc123xyz-country-US-city-LosAngeles:password
# Combined options
wp_abc123xyz-country-US-state-NY-city-NewYork-session-abc123:password
Authentication Methods
URL-Based Authentication
Include credentials directly in the proxy URL:
# HTTP/HTTPS
http://USERNAME:PASSWORD@proxy.weproxies.com:1080
Header-Based Authentication
For HTTP/HTTPS proxies, you can use the Proxy-Authorization header:
curl -x "proxy.weproxies.com:1080" \
-H "Proxy-Authorization: Basic $(echo -n 'USERNAME:PASSWORD' | base64)" \
https://api.ipify.org
Environment Variables
Set proxy credentials via environment variables:
export HTTP_PROXY="http://USERNAME:PASSWORD@proxy.weproxies.com:1080"
export HTTPS_PROXY="http://USERNAME:PASSWORD@proxy.weproxies.com:1080"
# Now all requests use the proxy
curl https://api.ipify.org
Security Best Practices
Keep Credentials Secure
Never share your proxy credentials or commit them to version control.
Recommended Practices
- Use environment variables - Don't hardcode credentials in your code
- Rotate passwords - Generate new credentials periodically
- Monitor usage - Check the dashboard for unusual activity
- Use IP whitelisting - If available, restrict access to specific IPs
Example: Using Environment Variables
import os
import requests
username = os.environ.get('WEPROXIES_USERNAME')
password = os.environ.get('WEPROXIES_PASSWORD')
proxy = {
"http": f"http://{username}:{password}@proxy.weproxies.com:1080",
"https": f"http://{username}:{password}@proxy.weproxies.com:1080"
}
response = requests.get("https://example.com", proxies=proxy)
Error Codes
| Error | Description | Solution |
|---|---|---|
407 Proxy Authentication Required | Invalid credentials | Check username/password |
403 Forbidden | Account suspended or no active subscription | Check account status |
429 Too Many Requests | Rate limited | Reduce request frequency |