Cloud HTTP Proxy support

We’re trying to use the HTTP Proxy feature mentioned here:

But it appears the proxy is used only when running it locally and not from the cloud:

HTTP_PROXY=<> HTTPS_PROXY=<> k6 run test.js - proxy working
HTTP_PROXY=<> HTTPS_PROXY=<> k6 cloud test.js - proxy ignored

We’ve also tried to set the env from the Grafana console → Performace → Setting → Environment Variables but still with no effect.

The question is whether using a custom HTTP proxy is supported for runs in the cloud or if it always uses Cloud IPs logic: Cloud IPs?

If not is there a way to use a custom HTTP proxy when running performance tests via k6 cloud test.js command? We need this because our website is hosted on a 3rd party service which might block IPs if there are too many requests. With the default Cloud IPs logic there are very few unique IPs used.

Hi @vilvovskyi,
unfortunately, I don’t think this is a supported feature. The main reason is that you’re not anymore testing your service, but your proxy will now influence the result.

In any case, if you need it for whatever reason, you could directly point your requests in the code to your proxy’s endpoint. You might set a variable for the base URL so you can change it between different environments.

If the default number of IPs is not enough and you are a Cloud customer then you can consider opening a ticket and asking for additional IPs or alternative solutions (e.g. Set up private load zones | Grafana Cloud documentation).

I hope it helps.