Hello, documentation recommends using `<http://0.0...
# server
n
Hello, documentation recommends using
<http://0.0.0.0:8080>
, but after starting the server, this address doesn't work.
<http://localhost:8080>
works, tho. Why is it so ?
l
i believe that 0.0.0.0 means to bind to all addresses on the machine - so localhost and 127.0.0.1, etc...
👍 2
it is not a valid address
c
you can only listen on 0.0.0.0 not connect to it
e
connecting to 0.0.0.0 does work on some operating systems, such as Linux
that's not standard across other OSes, but binding to 0.0.0.0 and listening is definitely a standard feature
c
what do you connect to when you connect to 0.0.0.0? any random interface?
l
yeah, 0.0.0.0 is a non-routable address, so connecting to it is kinda...janky
e
in practice, you get "any local address" when connecting to 0.0.0.0, same as when binding. it's definitely not something you should rely on to be portable, though
👍 2
l
yeah, you said that better than me: it might work..but relying on it to is a Bad Idea (tm) 🙂
e
if you only care about Linux then rely away 😛
🤣 1