Search code examples
pythonnetwork-programmingcherrypy

Can't see page in local lan


I try to setup a simple webinterface with cherrypy & python.

The page is visible over localhost:8080. If I try a different computer on the same LAN and try to connect with it via 192.168.1.100:8080 it doesn't work however. Do I need to open some ports? I thought this would not be needed with linux.

OS: Ubuntu on both systems
Tried Browsers Chrome & midori


Solution

  • Make sure to bind your server to 0.0.0.0:8080 instead of localhost:8080.

    localhost always resolves to the loopback interface, which is only reachable from the same host.

    0.0.0.0 on the other hand means "all interfaces" (also known as INADDR_ANY).

    For details read up about INADDR_LOOPBACK and INADDR_ANY in the ip(7) manpage.