From "What Is It" to "It's Actually Working"
Understanding what a residential proxy does is the easy part. Getting your first request to actually route through one โ without a silent authentication failure, a timeout, or your scraper quietly using your real IP the whole time โ is where most people lose an afternoon.
This walkthrough gets you from a fresh BuyProxy account to working code in Python, Node.js, cURL, and a headless browser, plus the fixes for the handful of problems everyone runs into.
Before You Write Any Code
You'll need three things:
A BuyProxy account โ create one at buyproxy.org/signup. New accounts get a 5-day free trial on the Pro plan (a card is required to start the trial, but you're only charged once the trial ends).
An active plan or top-up balance โ see buyproxy.org/pricing for subscription tiers, or fund a pay-as-you-go balance from $1.99/GB (5 GB minimum).
Your proxy credentials โ generated from your BuyProxy dashboard after signup.
Once you have credentials, the connection details are:
Host:
gate.buyproxy.orgHTTP/HTTPS port:
1000SOCKS5 port:
1002
Nothing to install locally. You point your HTTP client (or your operating system's proxy settings) at that host and port with your username and password, and you're routing through the residential network.
Rotating vs. Sticky: Pick the Right Mode First
This is the single most important decision before you write your integration. BuyProxy supports two session behaviors, and using the wrong one is the most common source of "why does this keep failing" bugs:
Rotating sessions โ a new residential IP on every request. Default behavior, ideal for scraping many pages where each request is independent.
Sticky sessions โ the same IP held for up to 30 minutes, so a login, a multi-step checkout, or a cart flow doesn't get treated as multiple unrelated visitors. You choose this mode when generating or configuring your session credentials in the dashboard.
Rule of thumb: if the target doesn't care about cookies or login state, rotate. If you're authenticating or maintaining any kind of session on the target site, go sticky.
Method 1: Python with requests
Basic rotating request
python
import requests
PROXY_USER = "your_username"
PROXY_PASS = "your_password"
PROXY_HOST = "gate.buyproxy.org"
PROXY_PORT = 1000
proxies = {
"http": f"http://{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}",
"https": f"http://{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}",
}
# Confirms the proxy is live โ should return a residential IP, not yours
response = requests.get("https://httpbin.org/ip", proxies=proxies, timeout=30)
print("Exit IP:", response.json()["origin"])
Sticky session across a login flow
python
import requests
proxies = {
"http": "http://your_username:your_password@gate.buyproxy.org:1000",
"https": "http://your_username:your_password@gate.buyproxy.org:1000",
}
session = requests.Session()
session.proxies = proxies
# Both requests exit from the same IP for up to 30 minutes when using
# a sticky-session credential set generated from your dashboard
login = session.post("https://example.com/login", data={"user": "me", "pass": "secret"})
account = session.get("https://example.com/account")
print(login.status_code, account.status_code)
Looping over multiple pages
python
import requests, time
proxies = {
"http": "http://your_username:your_password@gate.buyproxy.org:1000",
"https": "http://your_username:your_password@gate.buyproxy.org:1000",
}
urls = [f"https://example.com/listing/{i}" for i in range(1, 6)]
results = []
for url in urls:
try:
r = requests.get(url, proxies=proxies, timeout=30)
results.append((url, r.status_code))
except requests.exceptions.ProxyError as e:
print(f"Proxy error on {url}: {e}")
time.sleep(1) # a small delay looks more natural than a tight loop
print(results)
Method 2: Node.js with axios
javascript
// npm install axios https-proxy-agent
const axios = require('axios');
const { HttpsProxyAgent } = require('https-proxy-agent');
const proxyUrl = 'http://your_username:your_password@gate.buyproxy.org:1000';
const httpsAgent = new HttpsProxyAgent(proxyUrl);
const response = await axios.get('https://httpbin.org/ip', { httpsAgent });
console.log('Exit IP:', response.data.origin);
BuyProxy also ships an official TypeScript SDK if you'd rather skip building the agent config by hand โ see the documentation for install instructions.
Method 3: cURL โ Fastest Way to Sanity-Check a Connection
bash
# Basic rotating request over HTTP
curl -x "http://user:pass@gate.buyproxy.org:1000" https://httpbin.org/ip
# Over SOCKS5
curl --socks5-hostname "gate.buyproxy.org:1002" -U "user:pass" https://httpbin.org/ip
# Confirm your exit IP
curl -x "http://user:pass@gate.buyproxy.org:1000" https://api.ipify.org
Run this twice in rotating mode โ you should see two different IPs. If you see your own real IP address instead, the proxy isn't wired in correctly and traffic is bypassing it.
Method 4: Puppeteer (Headless Browser)
For pages that require JavaScript rendering:
javascript
const puppeteer = require('puppeteer');
const browser = await puppeteer.launch({
args: ['--proxy-server=http://gate.buyproxy.org:1000'],
headless: true,
});
const page = await browser.newPage();
await page.authenticate({ username: 'your_username', password: 'your_password' });
await page.goto('https://example.com');
console.log((await page.content()).substring(0, 300));
await browser.close();
Method 5: Environment Variables (Works With Almost Anything)
bash
export HTTP_PROXY="http://user:pass@gate.buyproxy.org:1000"
export HTTPS_PROXY="http://user:pass@gate.buyproxy.org:1000"
python my_scraper.py
node my_bot.js
Any HTTP client or CLI tool that respects the standard proxy environment variables will pick this up automatically โ no code changes needed.
Common Problems and How to Fix Them
"Cannot connect to proxy" errors
Double-check your username and password against what's shown in your BuyProxy dashboard, and confirm your firewall allows outbound connections on port 1000 (or 1002 for SOCKS5). Test with the cURL command above before touching your actual scraper code โ it isolates whether the problem is the proxy connection or your application logic.
SSL certificate errors
Make sure your client is using standard HTTPS tunneling (the CONNECT method), which is how BuyProxy's gateway handles HTTPS traffic. Most modern HTTP libraries do this correctly out of the box; if you've hand-rolled a socket connection, this is usually the culprit.
Requests timing out
Residential connections route through real consumer connections, so latency varies more than a datacenter proxy. Set your timeout to at least 30 seconds, and don't treat an occasional slow response as a broken integration.
Getting blocked despite using residential IPs
IP reputation is only one signal modern anti-bot systems check. If you're still getting flagged:
Add a small, randomized delay between requests
Rotate your User-Agent header along with the IP
Switch to a headless browser for JavaScript-heavy targets instead of a plain HTTP client
Make sure you're on a sticky session for anything involving login state
The same IP keeps showing up on every request
You're probably reusing a session object or sticky-session credentials that were meant for a single continuous flow. Use fresh rotating credentials, or start a new session, if you actually want a new IP each time.
A Few Habits That Save You Money and Headaches
Cap concurrency per target domain. Even with rotation, firing 500 simultaneous requests at one domain looks nothing like organic traffic. Keep it in the 10โ50 concurrent range per target.
Cache what doesn't change. You're billed per gigabyte โ re-fetching identical pages burns budget for no reason.
Watch your usage in real time. The BuyProxy dashboard includes live analytics so you can catch a runaway job before it eats through your balance. There's also a REST API for pulling usage data programmatically โ details in the docs.
Frequently Asked Questions
How do I confirm my proxy is actually working?
Run curl -x "http://user:pass@gate.buyproxy.org:1000" https://api.ipify.org twice. Two different IPs means rotation is working; your own IP means the proxy isn't wired in.
Does BuyProxy work with Selenium?
Yes โ pass the proxy through ChromeOptions or your WebDriver's proxy configuration the same way you would any HTTP proxy, then authenticate with your credentials.
What about async Python (httpx, aiohttp)?
Both support proxy configuration natively โ point the client at http://user:pass@gate.buyproxy.org:1000 the same way you would with requests.
Do I need to install anything locally?
No. BuyProxy is a hosted gateway โ point any standard HTTP or SOCKS5 client at the endpoint with your credentials.
Is there an SDK if I don't want to manage proxy config by hand?
Yes โ official SDKs are available for TypeScript, Python, Go, PHP, and Ruby. See buyproxy.org/docs.
Wrapping Up
Once you understand the connection model โ one fixed gateway, standard proxy authentication, rotating or sticky sessions chosen up front โ integrating BuyProxy into any stack is a five-minute job, not an afternoon of debugging. Grab your credentials from the dashboard, pick the code sample above that matches your stack, and you're routing through real residential IPs.
Explore the full residential proxy network or dig into API references and SDKs in the documentation.
Frequently Asked Questions
How do I confirm my proxy is actually working?+
Run curl -x "http://user:pass@gate.buyproxy.org:1000" https://api.ipify.org twice. Two different IPs means rotation is working; your own IP means the proxy isn't wired in.
Does BuyProxy work with Selenium?+
Yes โ pass the proxy through ChromeOptions or your WebDriver's proxy configuration the same way you would any HTTP proxy, then authenticate with your credentials.
What about async Python (httpx, aiohttp)?+
Both support proxy configuration natively โ point the client at http://user:pass@gate.buyproxy.org:1000 the same way you would with requests.
Do I need to install anything locally?+
No. BuyProxy is a hosted gateway โ point any standard HTTP or SOCKS5 client at the endpoint with your credentials.
Is there an SDK if I don't want to manage proxy config by hand?+
Yes โ official SDKs are available for TypeScript, Python, Go, PHP, and Ruby. See buyproxy.org/docs.
Need residential proxies right now? Start free โ no card required.
Sign up free โWritten by
The BuyProxy Team
The BuyProxy team writes about residential proxy infrastructure, geo-targeting, session management, and best practices for scraping and data collection at scale.
Try residential proxies free
Rotating and sticky sessions, city-level geo-targeting, full HTTP/HTTPS/SOCKS5 support.