#
Remote Server
Warning
Warning! This feature is experimental. It uses a hacky workaround to gain access to undocumented Playwright methods.
Camoufox can be ran as a remote websocket server. It can be accessed from other devices, and languages other than Python supporting the Playwright API.
#
Launching
To launch a remote server, run the following CLI command:
python -m camoufox server
Or, configure the server with a launch script:
from camoufox.server import launch_server
launch_server(
headless=True,
geoip=True,
proxy={
'server': 'http://example.com:8080',
'username': 'username',
'password': 'password'
}
)
#
Connecting
To connect to the remote server, use Playwright's connect
method:
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
# Example endpoint
browser = p.firefox.connect('ws://localhost:34091/8c7c6cdea3368d937ef7db2277d6647b')
page = browser.new_page()
...
Note
Because servers only use one browser instance, fingerprints will not rotate between sessions. If you plan on using Camoufox at scale, consider rotating the server between sessions.