Hmm, ping localhost seems to work on Windows even without the hosts file pointing
127.0.0.1 to localhost. –
Pacerier
CommentedJul 23, 2015 at 14:01
1
Agree with Pacerier. At least in Windows, localhost behaves as
0.0.0.0 (not
127.0.0.1) by default –
drodsou
CommentedDec 30, 2016 at 20:05
25
"This is mostly correct except for your description of binding to 0.0.0.0. This doesn't bind to every available network interface as you've described but rather binds to all addresses. In TCP stacks this is known as INADDR_ANY – from deleted answer of @strangemonad. –
Piotr Dobrogost
CommentedJan 18, 2017 at 13:09
12
Just to emphasize another common misunderstanding; you can't connect to
0.0.0.0 with a client, you have to know which actual addresses the server is listening on. For example, if the server runs on a system which has the addresses
10.9.8.7 and
192.168.128.64, you can connect to either of those (and
127.0.0.1 on the server system itself) when the server process listens to
0.0.0.0 (assuming of course that firewalls etc do not separately block your access for other reasons). –
tripleee
CommentedMay 4, 2022 at 5:32
what about telling to listen on http://* vs
0.0.0.0? In my understanding it is the same. Is there a difference? –
OverInflatedWalrus
CommentedNov 11, 2022 at 10:12