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=10.0.0.4 test.js
The script tries to access the API on
10.0.0.4 is the local IPv4 address.
The error is:
Request Failed error="Get \"http://127.0.0.1:5000/get\": dial tcp 10.0.0.4:0->127.0.0.1:5000: connectex: The requested address is not valid in its context."