Code samples
Swap PASSWORD for the one on your plan page and run any of these. Each one asks httpbin which IP it sees, so you can watch the address change.
curl
Give the login to -U and keep it out of the proxy address, which saves you escaping odd characters in the password.
curl -x resi.proxies.boo:8080 -U "USERNAME-country-us-time-600-session-a1b2c3d4:PASSWORD" https://httpbin.org/ip
# Through SOCKS5, with DNS looked up on our side
curl --socks5-hostname resi.proxies.boo:1080 -U "USERNAME-country-us-time-600-session-a1b2c3d4:PASSWORD" https://httpbin.org/ipPython with httpx
import httpx
PROXY = "http://USERNAME-country-us-time-600-session-a1b2c3d4:PASSWORD@resi.proxies.boo:8080"
with httpx.Client(proxy=PROXY, timeout=30) as client:
print(client.get("https://httpbin.org/ip").json()["origin"])Python with aiohttp, many requests at once
import asyncio, aiohttp
PROXY = "http://resi.proxies.boo:8080"
AUTH = aiohttp.BasicAuth("USERNAME-country-us-time-600-session-a1b2c3d4", "PASSWORD")
async def one(session):
async with session.get("https://httpbin.org/ip", proxy=PROXY, proxy_auth=AUTH) as r:
return (await r.json())["origin"]
async def main():
timeout = aiohttp.ClientTimeout(total=30)
async with aiohttp.ClientSession(timeout=timeout) as session:
print(await asyncio.gather(*(one(session) for _ in range(5))))
asyncio.run(main())Node.js with axios
import axios from "axios";
const { data } = await axios.get("https://httpbin.org/ip", {
proxy: { protocol: "http", host: "resi.proxies.boo", port: 8080, auth: { username: "USERNAME-country-us-time-600-session-a1b2c3d4", password: "PASSWORD" } },
timeout: 30000,
});
console.log(data.origin);Puppeteer
Chrome takes the proxy address at launch and the login per page.
import puppeteer from "puppeteer";
const browser = await puppeteer.launch({ args: ["--proxy-server=http://resi.proxies.boo:8080"] });
const page = await browser.newPage();
await page.authenticate({ username: "USERNAME-country-us-time-600-session-a1b2c3d4", password: "PASSWORD" });
await page.goto("https://httpbin.org/ip");
console.log(await page.evaluate(() => document.body.innerText));
await browser.close();Go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"time"
)
func main() {
proxy, _ := url.Parse("http://USERNAME-country-us-time-600-session-a1b2c3d4:PASSWORD@resi.proxies.boo:8080")
client := &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxy)}, Timeout: 30 * time.Second}
res, err := client.Get("https://httpbin.org/ip")
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init("https://httpbin.org/ip");
curl_setopt_array($ch, [
CURLOPT_PROXY => "resi.proxies.boo:8080",
CURLOPT_PROXYUSERPWD => "USERNAME-country-us-time-600-session-a1b2c3d4:PASSWORD",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
echo curl_exec($ch);A pool of sticky IPs
Each distinct session value is its own IP for as long as the time you set. This builds a pool of twenty, one per worker or account:
import uuid
def sticky(minutes=10):
tag = uuid.uuid4().hex[:8]
return f"http://USERNAME-country-us-time-{minutes * 60}-session-{tag}:PASSWORD@resi.proxies.boo:8080"
pool = [sticky() for _ in range(20)]Before you blame the proxy
- The proxy address itself is
http://, also when the site you open is https. Anhttps://in front of our host is the most common setup mistake. - A password with
@,:or/in it must be percent-encoded inside a URL, or passed separately as in the curl and aiohttp examples. - Always set a timeout. A home or phone connection can stall, and a request without a limit waits for good.
- Libraries reuse open connections. On a rotating plan, open a new connection when you want a new IP.
- When driving a browser, block images, fonts and media you do not need: pages then use a fraction of the traffic.
Stuck on something else? See fixing problems, or ask us in the live chat.
Need a hand? Open the chat bubble or email support@proxies.boo.