Unable to make my application listen on IPv6 interface on localhost

Viewed 53

I'm trying to make my application to work on IPv6 while on localhost in the development environment:

config :my_app, MyAppWeb.Endpoint,

  http: [port: System.get_env("PORT", "8000"), ip: {0, 0, 0, 0, 0, 0, 0, 0}],
  # http: [:inet6, port: System.get_env("PORT", "8000")],
  # ......

Nonetheless, accessing my application IPv6 won't load it:

[1111:2222: .....]:8000

whereas localhost:8000 will normally, as always.

How to make it work with IPv6? On localhost, in the dev env.

update1

  http: [port: System.get_env("PORT", "8000"), ip: "::1"],

still won't work

update2

  http: [:inet6, port: System.get_env("PORT", "8000"), ip: "::1"],

still won't work


How to get Phoenix to listen on IPv6? -- nothing has worked

2 Answers

That is not the IPv6 loopback address, it is the IPv6 unspecified address. You normally configure localhost to a loopback address (an address in the 127.0.0.0/8 IPv4 loopback block, or ::1 for IPv6).

You are trying to use the IPv6 :: address, but that is basically the same as 0.0.0.0 for IPv4.

You can try an empty string like this ""
use netstat -ano | findstr LISTEN to confirm it listening on ipv6

Related