Your First Proxy Request
This guide walks you through making your first successful proxy request with detailed examples.
Prerequisites
- ✅ WeProxies account created
- ✅ Active subscription or pay-as-you-go balance
- ✅ Proxy credentials ready
Testing Your Connection
Before integrating into your application, let's verify your proxy works:
Step 1: Basic Connectivity Test
# Test proxy connection (should return a proxied IP)
curl -x "http://YOUR_USERNAME:YOUR_PASSWORD@proxy.weproxies.com:1080" \
https://api.ipify.org?format=json
Expected response:
{"ip": "203.45.167.89"}
Step 2: Verify Country Targeting
# Request a US IP
curl -x "http://YOUR_USERNAME-country-US:YOUR_PASSWORD@proxy.weproxies.com:1080" \
https://api.ipify.org?format=json
# Check the IP geolocation
curl -x "http://YOUR_USERNAME-country-US:YOUR_PASSWORD@proxy.weproxies.com:1080" \
https://ipapi.co/json/
Expected response (location should match targeted country):
{
"ip": "203.45.167.89",
"country": "US",
"country_name": "United States",
"region": "California",
"city": "Los Angeles"
}
Code Examples
Python with Requests
import requests
# Your credentials
USERNAME = "wp_abc123xyz"
PASSWORD = "your-password"
PROXY_HOST = "proxy.weproxies.com"
PROXY_PORT = "1080"
# Configure proxy
proxies = {
"http": f"http://{USERNAME}:{PASSWORD}@{PROXY_HOST}:{PROXY_PORT}",
"https": f"http://{USERNAME}:{PASSWORD}@{PROXY_HOST}:{PROXY_PORT}"
}
# Make request
response = requests.get(
"https://httpbin.org/ip",
proxies=proxies,
timeout=30
)
print(f"Status: {response.status_code}")
print(f"Response: {response.json()}")
Python with Country Targeting
import requests
def create_proxy(username, password, country=None, session=None):
"""Create proxy URL with optional targeting."""
user = username
if country:
user += f"-country-{country}"
if session:
user += f"-session-{session}"
return {
"http": f"http://{user}:{password}@proxy.weproxies.com:1080",
"https": f"http://{user}:{password}@proxy.weproxies.com:1080"
}
# Rotating US proxy
proxy = create_proxy("wp_abc123xyz", "your-password", country="US")
response = requests.get("https://httpbin.org/ip", proxies=proxy)
print(response.json())
# Sticky session (same IP)
proxy = create_proxy("wp_abc123xyz", "your-password", country="US", session="mysession")
for i in range(3):
response = requests.get("https://httpbin.org/ip", proxies=proxy)
print(f"Request {i+1}: {response.json()}")
Node.js with Axios
const axios = require('axios');
const HttpsProxyAgent = require('https-proxy-agent');
const USERNAME = 'wp_abc123xyz';
const PASSWORD = 'your-password';
const PROXY_URL = `http://${USERNAME}:${PASSWORD}@proxy.weproxies.com:1080`;
const agent = new HttpsProxyAgent(PROXY_URL);
async function makeRequest() {
try {
const response = await axios.get('https://httpbin.org/ip', {
httpsAgent: agent,
timeout: 30000
});
console.log('Response:', response.data);
} catch (error) {
console.error('Error:', error.message);
}
}
makeRequest();
cURL Examples
# Basic request
curl -x "http://wp_abc123xyz:password@proxy.weproxies.com:1080" \
https://httpbin.org/ip
# With verbose output for debugging
curl -v -x "http://wp_abc123xyz:password@proxy.weproxies.com:1080" \
https://httpbin.org/ip
# With custom headers
curl -x "http://wp_abc123xyz:password@proxy.weproxies.com:1080" \
-H "User-Agent: Mozilla/5.0" \
-H "Accept-Language: en-US,en;q=0.9" \
https://httpbin.org/headers
Verifying Success
A successful proxy request will show:
- Different IP address - Not your real IP
- Correct country - Matches your targeting (if specified)
- 200 OK status - Request completed successfully
Check Your IP
# Your real IP (without proxy)
curl https://api.ipify.org?format=json
# Proxied IP (with proxy)
curl -x "http://USERNAME:PASSWORD@proxy.weproxies.com:1080" \
https://api.ipify.org?format=json
The IPs should be different!
Common Issues
Connection Refused
curl: (7) Failed to connect to proxy.weproxies.com port 1080
Solution: Check your network/firewall allows outbound connections to port 1080.
Authentication Failed
HTTP/1.1 407 Proxy Authentication Required
Solution: Verify your username and password are correct.
Timeout
curl: (28) Operation timed out
Solution:
- Increase timeout value
- Check your internet connection
- Try again (temporary network issue)
Next Steps
Now that you've made your first request: