PiratProxies

Antidetect browsers

How to set up a proxy in Camoufox

Camoufox is an open-source antidetect build of Firefox made for automation. It is driven from Python through the Playwright API.

Why Camoufox needs a proxy

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.

Which proxy to use

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.

What to enter

A PiratProxies plan gives you four things: a host, a port, a username and a password. These are the values for Residential; the username and password are on your plan page.

Hostresi.piratproxies.com
HTTP port8080
SOCKS5 port1080
UsernameUSERNAME
Passwordfrom your plan page

The country and the session are chosen in the username, not in a separate setting. The generator on your plan page writes the username for you, and Targeting and sessions explains each part.

Steps

  1. Install it with pip install "camoufox[geoip]" and run camoufox fetch once to download the browser.
  2. Pass the proxy as a dictionary with server, username and password.
  3. Set geoip=True so the timezone, language and location follow the proxy's IP address.

Example

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"))

Replace USERNAME and PASSWORD with the login from your plan page. The example asks an IP-check address, so the output is the address your request left from.

Rotating or sticky

Give each Camoufox profile a sticky session of its own, so the profile comes back from the same IP address each time it is opened. One profile, one session ID: a session ID shared by two profiles gives them the same address, which links them. Rotating on every request suits scraping, not an account that is meant to look like one person.

A sticky username looks like this:

USERNAME-country-us-time-600-session-a1b2c3d4

If it does not work

  • Give the username and password as separate keys. Credentials written inside the server address are ignored.
  • For a sticky session, put the session in the username: USERNAME-country-us-time-600-session-a1b2c3d4.
  • A 407 error means the username or password was not accepted. Copy both again from your plan page, and check that nothing added a space or cut the username short.
  • If the IP address is in the wrong country, look at the username: the country code is part of it. More fixes.

Questions

Does Camoufox work with SOCKS5 proxies?

No. Use the HTTP port, 8080. It carries both http and https sites.

Which PiratProxies proxy should I use with 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.

Camoufox is a product of its own makers. PiratProxies is not affiliated with it; the name is used here only to say what this guide is about. Use it within the rules of the sites you work with and our acceptable use policy.