How to Use Proxies With Obscura Headless Browser: Complete Setup Guide

To use a proxy with Obscura, add --proxy http://USER:PASS@PROXY_HOST:PROXY_PORT to any command (fetch, serve, scrape, or mcp). For Puppeteer and Playwright, set it on obscura serve and connect your scripts to that server. Obscura does not rotate IPs on its own, so use a rotating proxy endpoint for that. Always run an IP check, because a badly formatted proxy value gives no error and Obscura uses your own IP.
Automation workflows often get restricted on targets, and a headless browser like Obscura handles half of this problem by aligning the browser's fingerprint to a real one. The other half depends on the IP the traffic carries. An IP with poor reputation or too many requests from the same IP can still get you restricted.
This is exactly where using proxies with Obscura helps, letting you control the IP reputation your traffic carries and spreading the traffic across multiple IPs.
This guide covers proxy setup for each of Obscura's four commands, plus Docker and systemd, how to keep Obscura's fingerprint consistent with the proxy, and troubleshoot some common problems.
How To Set Up a Proxy in Obscura
Obscura has four subcommands. The --proxy flag works the same way on all of them, before or after the subcommand, but its scope is different for each. The next sections of the guide explain the process of proxy configuration for each subcommand and discuss its scope.
Method 1: Obscura Fetch With --proxy For One-Off Requests
For a one-off request like obscura fetch, you can pass the proxy details via the --proxy flag on the command line.
obscura fetch https://TARGET_URL.com --proxy http://USER:PASS@PROXY_HOST:PROXY_PORTTo verify that the command actually uses the specified proxy, you can target an IP-echo page like api.ipify.org.
obscura fetch https://api.ipify.org --proxy http://USER:PASS@PROXY_HOST:PROXY_PORT --dump textIf the IP shown in the command output matches your proxy IP, or, in the case of a rotating proxy, is different from your system’s public IP, the proxy configuration was successful.

Always run this check. Obscura does not show an error when the proxy value is malformed. It loads the page from your own IP instead. Use the URL format shown above, not the host:port:user:pass format that some dashboards export.
Method 2: Obscura Serve With --proxy for Puppeteer and Playwright
With Puppeteer or Playwright, the script does not launch its own browser. You start one Obscura server (obscura serve), which exposes a Chrome DevTools Protocol (CDP) endpoint, and your scripts connect to it as a remote browser. Every script that connects uses the proxy the server was started with:
obscura serve --proxy http://USER:PASS@PROXY_HOST:PROXY_PORT --stealth --storage-dir ./data --port 9222Here, --proxy sets the proxy that the Obscura server will use. If you do not want to specify the proxy each time you start a server, you can save your proxy details in the OBSCURA_PROXY environment variable.
This way, each time you start the Obscura server, it uses the proxy set in the environment variable. Be mindful that the OBSCURA_PROXY variable set in a terminal is temporary and only applies to the specific terminal session it was set in.
The --stealth flag needs a build that includes the stealth feature, so download the archive with -stealth in its name. The standard build accepts the flag without any warning, but it does not add TLS impersonation.
Once the server is started, it will give you a CDP endpoint.

You can configure this endpoint as a remote browser in your automation script. The following Playwright example connects to it and prints the body of the target IP-echo page.
var chromium = require('playwright').chromium;
var browser;
chromium.connectOverCDP('ws://127.0.0.1:9222')
.then(function (b) {
browser = b;
return browser.contexts()[0] || browser.newContext();
})
.then(function (context) {
return context.newPage();
})
.then(function (page) {
return page.goto('https://api.ipify.org').then(function () {
return page.innerHTML('body');
});
})
.then(function (body) {
console.log(body);
return browser.close();
})
.catch(function (err) {
console.error(err);
process.exit(1);
});Once run, this script will use the proxy the Obscura server is started with, and you can verify that by matching the shown IP with your proxy’s IP.

Note that if you are running multiple scripts using the same Obscura server endpoint, all of them will use the same proxy configured with the Obscura server. If you want different scripts to be using different proxies, then you can start multiple Obscura server endpoints on different ports.
Once you have different proxies integrated on different Obscura endpoints, you can configure your scripts to use those endpoints. This way, each automation workflow exits from its own IP. Give each instance its own --storage-dir too, because instances that share a storage folder also share cookies.
Method 3: Obscura Scrape With --proxy
To run the Obscura scrape command with a proxy, you can use the --proxy flag. The following scrape command targets the URL api.ipify.org and outputs the body text.
obscura scrape --proxy http://USER:PASS@PROXY_HOST:PROXY_PORT https://api.ipify.org --eval "document.body.innerText"If the IP shown here matches your proxy IP, it indicates successful proxy integration.

If you want to scrape multiple URLs at once, you can read URLs from a file by using xargs:
xargs obscura scrape --proxy http://USER:PASS@PROXY_HOST:PROXY_PORT --eval "document.body.innerText" --concurrency 20 < urls.txtThe --concurrency flag, with the default value of 10, limits how many obscura-worker processes run simultaneously.
When using a proxy, make sure that the set value of the --concurrency flag stays within what your proxy plan allows. With Byteful proxies, there is no limit on concurrent connections, and you can set it to whatever you require.
Note: To prevent misuse of the network, Byteful now limits proxy connections to domain names only. With Obscura, an http:// proxy URL already sends the domain name to the proxy. If you use SOCKS5, write the proxy URL as socks5h:// instead of socks5://, because the plain socks5:// form resolves the domain on your own machine and sends the proxy an IP address. Depending on your use case, direct IP access can be unlocked after KYC verification__.
Method 4: Obscura MCP With --proxy
Running the “obscura mcp …” command exposes Obscura as a Model Context Protocol (MCP) server that any MCP-capable client, like Claude Code or an agent like OpenClaw, can drive directly. When the agent calls a browser tool, the browsing session exits through the proxy you specified in the command.
obscura mcp --stealth --proxy http://USER:PASS@PROXY_HOST:PROXY_PORTTo register this MCP server in OpenClaw, use the command:
openclaw mcp set obscura '{
"command": "obscura",
"args": ["mcp", "--stealth", "--proxy", "http://USER:PASS@PROXY_HOST:PROXY_PORT"]
}'This command adds the MCP entry in OpenClaw’s openclaw.json file. Once done, any browsing the agent performs through the Obscura browser exits through your proxy.

Note: If OpenClaw has its built-in browser plugin enabled, the agent may use that browser by default instead of Obscura. To avoid this, you can either disable the built-in browser or explicitly ask the agent to use the Obscura headless browser.
Method 5: Obscura in Docker and Systemd With a Proxy
The methods explained so far run Obscura from a terminal session. If you want to keep Obscura continuously running in the background as a service that your scripts can connect to, then you’ll need it in Docker or under systemd. Either way, the proxy is set once on the service, and every Obscura browser request goes through it.
To run Obscura in a Docker container with a proxy, first create the storage directory owned by the same user the container runs as:
sudo install -d -o 65532 -g 65532 /srv/obscura/dataOnce done, generate the CDP token in your shell and then start the Docker container:
export OBSCURA_CDP_TOKEN="$(openssl rand -hex 32)"
docker run -d --name obscura -p 127.0.0.1:9222:9222 -e OBSCURA_CDP_TOKEN -v /srv/obscura/data:/data h4ckf0r0day/obscura serve --host 0.0.0.0 --proxy http://USER:PASS@PROXY_HOST:PROXY_PORT --storage-dir /dataThe first command generates a 32-byte token and stores it in your shell as the value of OBSCURA_CDP_TOKEN. This variable is required for security purposes as Obscura is connecting to 0.0.0.0 inside the container.
The Docker command uses -e OBSCURA_CDP_TOKEN without any value, so Docker passes the token from your current environment into the container.
The --proxy sets the proxy for this container, and --host 0.0.0.0 lets Obscura listen on all interfaces. This is required because the container’s loopback address is not reachable from outside, so without it your scripts can’t connect to Obscura.
Once you have the running Obscura container, you can connect your scripts to the Obscura Browser. For the scripts to run smoothly, Obscura requires the same token in the script’s connection headers so configure your script to pick up the value from the environment variable.
var browser;
chromium.connectOverCDP('ws://127.0.0.1:9222', {
headers: {Authorization: `Bearer ${process.env.OBSCURA_CDP_TOKEN}`}
})If you run your script from the same shell you exported the OBSCURA_CDP_TOKEN from, it’ll keep the container and the script on the same token.
Now that the Obscura server is running in the container with your host connecting to it over port 9222, your scripts can use it as a headless browser.
But if you would rather skip the Docker setup and prefer systemd to manage Obscura as a native process on the host, you can configure the proxy in the Obscura systemd service.
To configure the proxy in the Obscura systemd service:
Create a service file named “obscura.service” in the /etc/systemd/system directory, with the following content in it.
[Unit]
Description=Obscura headless browser
After=network.target
[Service]
ExecStart=/usr/local/bin/obscura serve --port 9222 --proxy http://USER:PASS@PROXY_HOST:PROXY_PORT --stealth --storage-dir /var/lib/obscura
Restart=always
RestartSec=5
User=obscura
Group=obscura
LimitNOFILE=65536
Environment=OBSCURA_PROXY=http://USER:PASS@PROXY_HOST:PROXY_PORT
Environment=OBSCURA_CDP_TOKEN=<your-token>
[Install]
WantedBy=multi-user.targetHere, make sure that you have created a user named “obscura” on your system and that the user has write permissions to the specified storage directory. The OBSCURA_CDP_TOKEN value in this file is the same token as explained previously and is generated the same way with “openssl rand -hex 32”. Export the same value in the terminal that runs your script.
Once done, reload the daemon with the command “sudo systemctl daemon-reload” and then restart the obscura service with “sudo systemctl restart obscura”.
Check the status of the service with “sudo systemctl status obscura” to make sure it is running. With the service active and the token exported in your terminal, your scripts connect to the exposed endpoint, as a browser, and every request goes out through the configured proxy.

Keep Obscura’s Fingerprint Consistent With the Proxy
Keeping your Obscura browser fingerprint consistent with the proxy IP is crucial. Because if your browser fingerprint says the traffic is coming from Berlin, but your proxy IP says otherwise, this mismatch can get your workflow restricted on strict targets.
Obscura provides a few environment variables that you can use to help keep your proxy IP and browser fingerprint consistent with each other.
OBSCURA_TIMEZONE: The default value of this variable is set to Europe/Berlin, and you can change it to match the timezone of your proxy IP’s exit location.
OBSCURA_GEOLOCATION: This sets the coordinates the browser reports, written as latitude and longitude. Make sure to keep it consistent with OBSCURA_TIMEZONE and the proxy IP’s location.
These variables cover the browser side, but the connection has its own fingerprint, which comes from the proxy's operating system. Obscura presents itself as Chrome on Windows by default, so the proxy should look like Windows too. We offer two beta features for this: TCP/IP Fingerprint Emulation on our datacenter and static residential proxies, and OS Targeting on our residential and mobile proxies. With either one, add the operating system to your proxy username, for example, USER_os_windows
Troubleshooting Proxy Issues in Obscura
While configuring proxies with Obscura, you may face several issues. This section lists some commonly faced issues when integrating proxies in Obscura along with the solution.
- Hitting a network error after all the configuration: Read the end of the error message. "proxy authorization required" means the username or password is wrong. "tls handshake" means the proxy URL starts with https:// but the port only accepts plain HTTP, so use the http:// form. For anything else, check the host and port, and use Byteful Proxy Tester to confirm the proxy is reachable.
- Session drops mid-run: This can happen if you are using rotating proxies and the IP changes mid-run. To avoid this problem, use a sticky session with a TTL longer than the run, or a static proxy. This matters most with --storage-dir, because saved cookies should keep meeting the same IP.
- Getting an “Invalid URL” error when the URL is correct: This happens when your URL looks like site.com. Obscura expects the URL in full format, e.g., https://site.com so use this format for your URLs.
- Getting 401 Unauthorized with systemd configuration: As with systemd, your script needs to send the OBSCURA_CDP_TOKEN value as an authorization header, and in this guide, we configured the script to read this value from the environment variable that was set in the terminal via the export command. Variables set via the export command are temporary and only apply to that specific terminal where the value was set. So, make sure that you are running the script from the same terminal where OBSCURA_CDP_TOKEN was set.
- Set the proxy in the variable, but it’s not working: OBSCURA_PROXY only works with obscura serve. The fetch, scrape, and mcp commands ignore it and run without a proxy, so pass --proxy to them instead. Do not rely on HTTP_PROXY or HTTPS_PROXY either. Obscura's documentation says it does not read them, but in our testing it still followed HTTPS_PROXY when no --proxy was set. Unset them, or pass --proxy, which always takes priority.
Which Proxy To Use With Obscura
Obscura takes one proxy URL per process and does not rotate IPs on its own, so the proxy type decides how your traffic is spread. Pick the type by the job you are running.
- Residential proxies: One endpoint gives a new IP on each new connection, so rotation happens on the proxy side with no extra setup. This suits fetch and scrape, where each scrape worker opens its own connection. Do not use a rotating endpoint with --storage-dir, because saved cookies would arrive from a different IP each time.
Pro Tip: A sticky session holds one IP, which suits obscura serve, logins, and multi-step runs. Set the TTL longer than the run. The IP can still change early if the device behind it goes offline.
- Static residential ISP proxies: These IPs are registered to real ISPs but hosted in datacenters, so you get one fixed IP with datacenter speed. They suit a --storage-dir profile that you reuse across runs. They also support TCP/IP Fingerprint Emulation, including macOS.
- Datacenter Proxies: These are usually the cheapest and fastest type. Use them to test your setup and for large scrape runs on targets that accept datacenter IPs.
Byteful offers all of these types, and our proxies are ethically sourced. Our datacenter and static residential proxies include unlimited bandwidth, which helps on large scrape runs. You can also test our proxies with our no-credit-card 1 GB of free, non-expiring residential data.
You can get the trial data after signing up on the dashboard and completing a short KYC. We ask for KYC before the trial so that the free data goes to genuine users, which helps keep the pool clean for everyone.


