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

后端 未结 8 1407
醉话见心
醉话见心 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:45

    Rails 4.1 Warning Message.

    FYI, on Rails 4.1 you will get a warning message on boot that looks like this:

    => Run `rails server -h` for more startup options
    => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
    

    This indicates that binding to 0.0.0.0 is not recommended and instead you should use 127.0.0.1.

    In Rails 4.2+ the Rails server default binding is to localhost instead of 0.0.0.0 or even 127.0.0.1.

提交回复
热议问题