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

后端 未结 8 1393
醉话见心
醉话见心 2020-12-13 04:00

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

8条回答
  •  盖世英雄少女心
    2020-12-13 04:42

    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.

提交回复
热议问题