Password proxy in nodriver

In nodriver a password proxy is set when creating a browser context. The library spins up a local auth relay by itself.

HTTPHTTPSSOCKS5Login and passwordRotation and sticky
nodriver · proxy
http://LOGIN:PASSWORD@HOST:PORT
["localhost"]
about:blank
✓ IP: Germany, residentialRun

Why use a proxy in nodriver

nodriver is an async library for driving Chrome over CDP without WebDriver, the successor of undetected-chromedriver by the same author. The proxy is set with the proxy_server parameter of browser.create_context. If the URL has a login and password, nodriver starts a local relay and connects the browser to it.

What to pick

Take an HTTP proxy; that path is the simplest. Per nodriver's code the relay also handles SOCKS5 with a password, but we suggest starting with HTTP. For different accounts create separate contexts on different sticky sessions.

Residential

from $0.6 / GB

Home ISP addresses. The main choice for accounts and protected sites.

VIP

$2 / GB

Hand-picked clean IPs, faster and more stable than regular residential.

Mobile

$4 / GB

Carrier IPs, for platforms that check addresses strictly.

Step-by-step setup

Button names are given exactly as they appear in nodriver.

  1. Install nodriver

    Run pip install nodriver. Chrome must be installed.

  2. Export the proxy

    Take login:pass@ip:port in @SousProxyBot or the dashboard and prepend http://.

  3. Create a context with the proxy

    After uc.start() call browser.create_context("about:blank", proxy_server=PROXY). It returns a tab in the new context.

  4. Open the page

    await tab.get("https://api.ipify.org?format=json"), then let the page load.

  5. Check the IP

    await tab.evaluate("document.body.innerText", return_by_value=True) returns JSON with the proxy IP.

Code example

Put in your own HOST, PORT, LOGIN and PASSWORD from the bot or the dashboard.

python
import nodriver as uc

PROXY = "http://LOGIN:PASSWORD@HOST:PORT"


async def main():
    browser = await uc.start()
    tab = await browser.create_context("about:blank", proxy_server=PROXY)
    await tab.get("https://api.ipify.org?format=json")
    await tab.sleep(2)
    print(await tab.evaluate("document.body.innerText", return_by_value=True))
    browser.stop()


if __name__ == "__main__":
    uc.loop().run_until_complete(main())

Tested by running it

We ran this example ourselves: Python 3.13.18 · nodriver 0.50.99 · Chrome for Testing 153.0.8010.12. Real output below, IP hidden.

Terminal · ip.py
$ python ip.py
{"ip":"proxy IP"}

And this is the response when the password is wrong:

$ python ip.py
…

The webpage at https://api.ipify.org/?format=json might be temporarily down or it may have moved permanently to a new web address.

ERR_TUNNEL_CONNECTION_FAILED

Common errors

The issues people most often bring to support.

!

The page opened with your IPYou opened the address with browser.get, not in the tab from create_context. The proxy applies only inside the created context.

!

Chrome asks for login and passwordThe proxy was passed as --proxy-server in browser_args. That flag doesn't understand a login; use create_context with proxy_server.

!

Empty result from evaluateThe page hadn't loaded. Increase tab.sleep or wait for an element with tab.select("body").

!

Browser fails to start as root in DockerPass sandbox=False to uc.start().

Need a proxy for nodriver?

Residential, VIP and mobile IPs. HTTP and SOCKS5, pay per GB, 1 GB free to try.

FAQ

Can I set the proxy for the whole browser?

Yes, with browser_args=["--proxy-server=http://HOST:PORT"] in uc.start(), but only for a proxy without a password. With a password use create_context.

How do I keep several IPs in one browser?

Create several contexts with different proxy_server values. Each context has its own cookies and its own proxy.

How do I check WebRTC?

Open /en/tools/webrtc-leak/ in the same context. If the real IP shows, disable WebRTC.