#
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'
},
port=1234,
ws_path='hello'
)
The server's port and URL path will be defined using the port
and ws_path
parameters, or will be random if not defined.
Websocket endpoint: ws://localhost:1234/hello
All of the following parameters are also supported:
#
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:1234/hello')
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.