Authentication & Usage
Learn how to authenticate and integrate PepeProxy proxies in your applications and scripts.
Proxy Format
When you generate proxies, they are provided in the standard proxy URL format:
protocol://username:password@host:port Example:
http://user_abc123:pass_xyz789@us-01.pepeproxy.com:2333 Credentials: Each proxy has unique username and password credentials. Keep these secure and never share them publicly.
Command Line Usage
Using curl
The simplest way to test your proxy is with curl:
curl -x http://username:password@us-01.pepeproxy.com:2333
-H "User-Agent: Mozilla/5.0"
https://api.ipify.org This should return your proxy’s IP address instead of your actual IP.
Python Integration
Using requests Library
The most popular Python HTTP library:
import requests
proxies = {
'http': 'http://username:password@us-01.pepeproxy.com:2333',
'https': 'http://username:password@us-01.pepeproxy.com:2333'
}
response = requests.get('https://httpbin.org/ip', proxies=proxies)
print(response.json()) Using aiohttp (Async)
For asynchronous Python applications:
import aiohttp
async def fetch():
proxy = 'http://username:password@us-01.pepeproxy.com:2333'
async with aiohttp.ClientSession() as session:
async with session.get('https://httpbin.org/ip', proxy=proxy) as response:
data = await response.json()
print(data) Node.js Integration
Using Axios
const axios = require('axios');
const proxy = {
host: 'us-01.pepeproxy.com',
port: 2333,
auth: {
username: 'username',
password: 'password',
},
};
axios
.get('https://httpbin.org/ip', { proxy })
.then((response) => console.log(response.data))
.catch((error) => console.error(error)); Using node-fetch
Requires the https-proxy-agent package:
const { HttpsProxyAgent } = require('https-proxy-agent');
const fetch = require('node-fetch');
const proxyUrl = 'http://username:password@us-01.pepeproxy.com:2333';
const agent = new HttpsProxyAgent(proxyUrl);
fetch('https://httpbin.org/ip', { agent })
.then((res) => res.json())
.then((data) => console.log(data))
.catch((error) => console.error(error)); Browser Automation
Puppeteer (Node.js)
Puppeteer has built-in proxy authentication support:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
args: ['--proxy-server=us-01.pepeproxy.com:2333'],
});
const page = await browser.newPage();
// Authenticate with proxy
await page.authenticate({
username: 'username',
password: 'password',
});
await page.goto('https://httpbin.org/ip');
const content = await page.content();
console.log(content);
await browser.close();
})(); Configuration Tips
Timeouts
Set appropriate timeout values when using proxies. Residential proxies can be slower than datacenter proxies:
- Connection timeout: 30-60 seconds
- Read timeout: 60-120 seconds
- Total timeout: 2-5 minutes
Retry Logic
Implement retry logic for failed requests. Some IPs may be temporarily unavailable:
- Retry 3-5 times with exponential backoff
- On failure, try a different proxy from your pool
- Handle 407 (Proxy Authentication Required) errors
User Agents
Always use realistic User-Agent headers to avoid detection:
- Match the User-Agent to your proxy’s location
- Use recent browser versions
- Rotate User-Agents if making many requests
- Consider using libraries like
fake-useragent(Python) oruser-agents(Node.js)
Headers
Include common browser headers to appear more legitimate:
AcceptAccept-LanguageAccept-EncodingReferer(when appropriate)
Common Errors
407 Proxy Authentication Required
- Your credentials are incorrect or not being sent properly. Double-check username and password.
Connection Timeout
- The proxy may be temporarily unavailable. Increase timeout values or try a different proxy.
403 Forbidden / 429 Too Many Requests
- The target website is blocking your requests. Add delays between requests, rotate User-Agents, and use sticky sessions for authenticated flows.
SSL Certificate Errors
- Some clients require SSL verification configuration. Consider using verify=False (Python) or rejectUnauthorized: false (Node.js) only for testing.
Best Practices
- Pool Management: Generate multiple proxies and rotate them to distribute requests
- Rate Limiting: Add delays between requests to avoid triggering anti-bot systems
- Session Persistence: Use sticky sessions when you need to maintain cookies or session state
- Monitoring: Track success rates and response times for each proxy
- Error Handling: Gracefully handle proxy failures and automatically switch to backup proxies
Next: Learn about pricing →