I am using Jekyll
and Vagrant
on my mac. I found that Jekyll server
will bind to 0.0.0.0:4000
instead of 127.0.0.1:4000
. Also gem server
will bind to this address by default. I can still visit it via http://localhost:port
. But for Jekyll
, it seems that the default setting (e.g. 0.0.0.0:4000) requires Internet access. I cannot run Jekyll server
without Internet. Is it a small bug?
I also use Vagrant
. I have set port forwarding(8080 => 4000) in Vagrantfile, since I install Jekyll
in Vagrant
virtual machine and test it under Macintosh. If I use the default setting (0.0.0.0:4000), it works. I can visit it from my safari with http://localhost:8080
. But if there is not internet, I cannot bind to 0.0.0.0:4000. I use jekyll server -H 127.0.0.1
to bind service to 127.0.0.1:4000
instead, then I cannot visit it via http://localhost:8080
.
Can anyone explain the difference between 0.0.0.0, 127.0.0.1 and localhost? And can anyone explain why the difference will cause this problem?