Need to launch a browser instance that uses a proxy

My automated tests use a proxy to ensure that the browser is not ip-authenticated. I need to do the same for the xk6-browser tests.
i used an example i found using playwright that supposedly launches it with proxy, but it does not work

here is the example of the code i used(scrubbed proprietary urls)

 const browser = chromium.launch({ headless: false, proxy: {
            server: '',
        }, });
    const page = browser.newPage();

Is this not supported yet ?

Hi @Jeet_S !

Unfortunately the proxy option is currently unimplemented, in the sense that it’s not being set when launching the browser. We have an issue open that relates to that and that you can use to track the availability of the feature.

Hi Team,

I amusing k6.exe v0.48.0 (commit/47c0a26798, go1.21.5, windows/amd64)

can we launch browser with proxy server setting


Could you try to launch the script with the K6_BROWSER_ARGS=“proxy-server=<proxy_host>:<proxy_port>” environment variable?
For me on linux it is working like this if I start a squid proxy on port 3128:

K6_BROWSER_HEADLESS=false K6_BROWSER_ARGS="proxy-server=" k6 run script.js

I hope it helps


Thanks @bandorko i need to skip few sites for proxy , can we pass it on BROWSER_ARGS

yes, you can like this:


Here you can find possible command line arguments for chromium:

1 Like

@bandorko what if i have a list of url to by pass

i tried


is not working.
am i missing the syntax ?

proxy-bypass-list is a semicolon separated list according to the documentation: Network Settings

Try it with;.okta.*;

1 Like