Set proxy on K6 Browser Automation

Hi Team,

To automate the user flow, I need to send the browser traffic through a dedicated proxy then only i can access it. While manual test we pointed our browsers to dedicated proxy then only the sites can be accessible.

With HTTP script “$env:HTTPS_PROXY=“http://localhost:8888/”; k6 run script.js” it was achieved.

How to achieve this K6-broser automation ?

Hi @gerardlj

You can use the

K6_BROWSER_ARGS="proxy-server=<proxy_host>:<proxy_port>"

environment variable

see: Need to launch a browser instance that uses a proxy - #5 by bandorko

Let me know if it helps.

2 Likes