127.0.0.1 is not just a different ip address to the machine ip address, it's a different interface as well. 127.0.0.1 should not be seen on the local network. It's a special internal IP address for the loopback adapter.
x.x.x.x will be your ethernet card.
by the way 'localhost' is simply an entry in your hosts file that points to 127.0.0.1
If you bind a socket to 127.0.0.1:8200 then only clients running locally will be able to access it and only withhttp://127.0.0.1:8200orhttp://localhost:8200(or
a dns or hosts file entry that points to 127.0.0.1).
A socket bound to x.x.x.x:8200 will only be available throughhttp://x.x.x.x:8200or
a dns or hosts file entry that points to that.
Binding a socket to 127.0.0.1 does not automatically make it available on the ethernet interface as well.
Thats why you can't connect to x.x.x.x:8200
You can bind port 8200 to all available interfaces (0.0.0.0) then it should work.
and
Localhost
refers to the term 'using on your computer offline', when you are not using internet connection and browsing offline then your server-side code is treated as localhost. On
the otherhand Web-host refers to a company that offers hosting services for your website. Your website resides on the hosting disk space, and bandwidth is managed by them. To run your site all steps are maintained by web hosting providers.
sriramabi
Contributor
4351 Points
1277 Posts
Re: Pages layout different between localhost and web server
Apr 25, 2012 04:41 PM|LINK
To answer your question.
127.0.0.1 is not just a different ip address to the machine ip address, it's a different interface as well. 127.0.0.1 should not be seen on the local network. It's a special internal IP address for the loopback adapter.
x.x.x.x will be your ethernet card.
by the way 'localhost' is simply an entry in your hosts file that points to 127.0.0.1
If you bind a socket to 127.0.0.1:8200 then only clients running locally will be able to access it and only with http://127.0.0.1:8200 or http://localhost:8200 (or a dns or hosts file entry that points to 127.0.0.1).
A socket bound to x.x.x.x:8200 will only be available through http://x.x.x.x:8200 or a dns or hosts file entry that points to that.
Binding a socket to 127.0.0.1 does not automatically make it available on the ethernet interface as well.
Thats why you can't connect to x.x.x.x:8200
You can bind port 8200 to all available interfaces (0.0.0.0) then it should work.
and
Localhost refers to the term 'using on your computer offline', when you are not using internet connection and browsing offline then your server-side code is treated as localhost.
On the otherhand Web-host refers to a company that offers hosting services for your website. Your website resides on the hosting disk space, and bandwidth is managed by them. To run your site all steps are maintained by web hosting providers.