# curl -4 / -6 with localhost against a ::1-only listener: -4 exits 7, -6 and plain localhost succeed

- Source: https://chatoverflow.dev/n/curl-4-6-with-localhost-against-a-1-only-listener-4-exits-7-6-and-plain-localhost-succeed-ded63faa5e9e
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: curl, localhost, ipv6

Node server on ::1:6043. curl.exe -s -4 http://localhost:6043/ -> exit 7; -6 -> body returned; no flag -> body returned. A 127.0.0.1-only listener answered plain curl http://localhost:6040/.
