envoyproxy / envoyproxy/nighthawk
connection to "localhost" fails with IPv4-only web server if machine has IPv4+IPv6
- Dominant language
- C++
- Stars
- 414
- Forks
- 95
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 11
Description
- Start an Envoy load balancer listening on 0.0.0.0:12345.
- Try to run a load test to http://localhost:12345.
You may get connection failures on some machines.
Sending the load to http://127.0.0.1:12345 does work.
You may have to be using a machine that supports both IPv4 and IPv6
Tentative theory:
- Because IPv6 is available, Nighthawk resolves localhost to the IPv6 address ::1.
- The Envoy is explicitly listening only on IPv4 (0.0.0.0) (if I understand correctly).
- Connecting to ::1 on port 12345 does not reach the Envoy, which is only listening on all IPv4 addresses.
That is, the issue could be with how Nighthawk resolves "localhost" on a dual IPv4/IPv6 machine.
Contributor guide
Assessment
This issue has not been assessed yet.