Frage

When I host a page in /var/www/page, I can view it via:

  • localhost/page
  • 192.xxx.x.xxx/page

Recently, I have started playing with websockets (using this repository).

When I activate the server, I can connect using localhost/page but not with 192.xxx.x.xxx/page (note that I can access the page but not connect to the server)

Can someone explain why?

War es hilfreich?

Lösung

"On most computer systems, localhost resolves to the address 127.0.0.1, which is the most-commonly used IPv4 loopback address..." (https://en.wikipedia.org/wiki/Localhost)

It's likely that the "localhost" host name is being resolved to the loopback interface IP address (127.0.0.1), as that is the standard on most machines.

If you want the server to respond to another IP address, you'll have to configure it.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top