What a proxy does for Camoufox
Camoufox changes what the browser reports about itself. The IP address is still yours until you pass a proxy, and its geoip option then sets the timezone and language to match that address.
The right proxy type for Camoufox
Residential proxies for sites that block data centres. For high-volume collection where the country is all that matters, Residential Lite costs less per gigabyte.
The values to enter in Camoufox
Every PiratProxies plan comes down to four values: host, port, username and password. Here they are for Residential; your own username and password are on your plan page.
| Host | resi.piratproxies.com |
|---|---|
| HTTP port | 8080 |
| SOCKS5 port | 1080 |
| Username | USERNAME |
| Password | shown on your plan page |
There is no separate country or session field: both are part of the username. Your plan page has a generator that writes it, and Targeting and sessions describes each piece.
Setting it up in Camoufox
- Install it with
pip install "camoufox[geoip]"and runcamoufox fetchonce to download the browser. - Pass the proxy as a dictionary with
server,usernameandpassword. - Set
geoip=Trueso the timezone, language and location follow the proxy's IP address.
Code: Camoufox through a proxy
Python
from camoufox.sync_api import Camoufox
proxy = {"server": "http://resi.piratproxies.com:8080", "username": "USERNAME", "password": "PASSWORD"}
with Camoufox(proxy=proxy, geoip=True) as browser:
page = browser.new_page()
page.goto("https://api.ipify.org")
print(page.inner_text("body"))Put your own login from the plan page in place of USERNAME and PASSWORD. The example calls an IP-check service, so what it prints is the address your request came from.
Should Camoufox rotate IPs or keep one?
Each Camoufox profile should have a sticky session that belongs to it alone, so that it reappears from the same IP address every time you open it. Two profiles sharing a session ID end up on the same address, and that ties them together. Changing IP on every request is for scraping; an account that has to look like one person needs a steady address.
Here is what a sticky username looks like:
USERNAME-country-us-time-600-session-a1b2c3d4When Camoufox will not connect
- Give the username and password as separate keys. Credentials written inside the
serveraddress are ignored. - For a sticky session, put the session in the username:
USERNAME-country-us-time-600-session-a1b2c3d4. - Error
407means the login was refused. Copy the username and password from your plan page once more, and make sure no space crept in and the username was not cut short. - An IP in the wrong country nearly always comes from the username, since the country code lives there. Other fixes.
Camoufox and proxies: questions
Can Camoufox use a SOCKS5 proxy?
No. Use the HTTP port, 8080, which handles http and https sites alike.
Which PiratProxies plan suits Camoufox best?
Residential proxies for sites that block data centres. For high-volume collection where the country is all that matters, Residential Lite costs less per gigabyte.
Words used in this guide: antidetect browser, browser fingerprint, sticky session, session ID, WebRTC leak.
Camoufox belongs to its own developers, and PiratProxies has no connection with them; we name it only to say what this guide covers. Follow the rules of the sites you visit and our acceptable use policy.