Error when using --local-ips to localhost


I am trying to use --local-ips and it works perfectly when requesting public IPs. When trying to fetch data from an API running on localhost, it fails. The script also works fine when fetching data from localhost without using --local-ips. Shouldn’t it be the same, specifying the main NICs IP address in the parameter, and running without the parameter?

This works fine:

k6 run test.js

This does not work:

k6 run --local-ips= test.js

The script tries to access the API on is the local IPv4 address.

The error is:

Request Failed error="Get \"\": dial tcp> connectex: The requested address is not valid in its context."

Hi there,

I can’t reproduce this on Linux and k6 v0.29.0. Can you confirm your OS and k6 version?

Based on that error I would assume you’re using Windows. It seems to be related to the “strong host” networking model, see this issue, so it’s not a k6 or even a Go issue.

According to this documentation you can try enabling “weak host” mode on that interface, which would make it behave as on Linux.



1 Like


I’m using v0.29.0, and Windows, yes.

I’ll look into your suggestion and come back with the result, thanks for the reply.