I am very new to Ruby on Rails so when I tried to follow the official "Getting Started" ruby on rails tutorial, I was a bit disappointed because it went wrong very quickly. Basically it said :
…navigate to http://localhost:3000. You should see Rails’ default information page.
But when I follow the instructions, I get
=> Rails 2.3.4 application starting on http://0.0.0.0:3000
After trying both addresses, I know that they point to the same thing, but can someone explain to me why Ruby on Rails uses http://0.0.0.0:3000
instead of http://localhost:3000
?
Is there a way to always have the WEBbrick server use localhost ?
Localhost means quite literally "your local host", usually identified by 127.0.0.1 and all traffic to that address is routed via a loopback interface. If your Web server is listening for connections on 127.0.0.1, this means that it only accepts requests coming from the same host.
0.0.0.0 means that Rails is listening on all interfaces, not just the loopback interface.