LoginSignup
4
7

More than 5 years have passed since last update.

RailsでWEBrickが127.0.0.1ではなく0.0.0.0で待ち受ける理由

Posted at

Railsでは起動ログを見ると 127.0.0.1 じゃなくて 0.0.0.0 で待ち受けてるのって何でだろう?
そもそも 0.0.0.0 ってなんだったっけ?

=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run rails server -h for more startup options
=> Ctrl-C to shutdown server

と思って調べたら、0.0.0.0 は「全てのアドレスを示す」ので外部からでも接続できるってことらしい。
そういえばVPSで動かしてみて試したような気がする。

Why does Ruby on Rails use http://0.0.0.0:3000 instead of http://localhost:3000? - Stack Overflow
http://stackoverflow.com/questions/1478747/why-does-ruby-on-rails-use-http-0-0-0-03000-instead-of-http-localhost3000

4
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
7