This is because by default Apache listens on *:80 which essentially means 0.0.0. If you’ve ever tried web development on PHP, you’d realize that the localhost web server was accessible using the IP of the computer’s LAN as well from other devices (say your mobile). When you try to establish a network connection to the 127.0.0.1 loopback address, it works in the same manner as making a connection. We specifically face the problem of differentiating them in Flask/Django/NodeJS applications because these are runtimes which require the user to define which IP (or routes) to listen on. Very often developers use 127.0.0.1 to test their applications. 127.0.0.1 is a loopback address 127.0.0.2 is a loopback address 127.0.0.3 is a loopback address and so on. When do you face the need to differentiate between them. What is 0.0.0.0Ġ.0.0.0 is a wildcard for all open routes to the system within the system where the script runs. I could ask to point to my loopback address and that would work same. Localhost is simply a conventional mapping done in the hosts file of the OS. When a remote host calls this, they’re actually calling themselves. It means, whatever request is made, send it back to the same machine. I shall attempt to answer the question in this post. The address 127.0.0.1 is the standard address for IPv4 loopback traffic the rest are not supported by all operating systems. I’ve been often asked, why do we sometimes need to specify the IP for a program to be 0.0.0.0 in order to get it to be accessible from machines outsides the network.
0 Comments
Leave a Reply. |