Why Does Ruby on Rails Use Http://0.0.0.0:3000 Instead of Http://Localhost:3000

Why does Ruby on Rails use http://0.0.0.0:3000 instead of http://localhost:3000?

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.

Rails starting in dev, says server is http://0.0.0.0

0.0.0.0 means that it's listening on all interfaces; in other words, anybody who knows your IP address can access your Rails application. This is normal.

Can't open http://localhost:3000 - why?

To kill all processes using port 3000 run kill -9 $(lsof -i tcp:3000 -t).

Rails not connecting on port 3000

Could you try start rails server with:

$ bundle exec rails server -b 0

Then go to http://localhost:3000



Related Topics



Leave a reply



Submit