Macos – Can’t connect to local IP address on OSX

connectlocalmacoswebserver

I'm trying to connect to a webserver that's running on my mac OSX 1.6. I'm able to connect to it locally using http://127.0.0.1:8888/myapp but when I attempt to connect to it using my machine's local IP address (http://192.168.1.15:8888/myapp IP shown below) from the same machine (or another on the network) I cannot connect. I can ping the LAN IP address.

I've tried adding IP forwarding to my router for port 8888 but it didn't help.
I've checked and the OSX firewall is disabled

Can anyone suggest what else is blocking the connection?

Here's what I get when I run ifconfig:

~ :ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    inet 127.0.0.1 netmask 0xff000000 
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:1f:5b:e8:16:4d 
    media: autoselect status: inactive
    supported media: autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 10baseT/UTP <full-duplex,flow-control> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 100baseTX <full-duplex,flow-control> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control> none
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::21e:c2ff:febf:4809%en1 prefixlen 64 scopeid 0x5 
    inet 192.168.1.15 netmask 0xffffff00 broadcast 192.168.1.255
    ether 00:1e:c2:bf:48:09 
    media: autoselect status: active
    supported media: autoselect
fw0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 4078
    lladdr 00:1f:5b:ff:fe:2b:b3:3c 
    media: autoselect <full-duplex> status: inactive
    supported media: autoselect <full-duplex>
en5: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500
    ether 00:1e:c2:8e:0f:45 
    media: autoselect status: inactive
    supported media: none autoselect 10baseT/UTP <half-duplex>
en2: flags=8922<BROADCAST,SMART,PROMISC,SIMPLEX,MULTICAST> mtu 1500
    ether 00:1c:42:00:00:00 
    media: autoselect status: inactive
    supported media: autoselect
en3: flags=8922<BROADCAST,SMART,PROMISC,SIMPLEX,MULTICAST> mtu 1500
    ether 00:1c:42:00:00:01 
    media: autoselect status: inactive
    supported media: autoselect

Best Answer

Your webserver is probably binding to the loopback interface by default. Applications can "bind" to specific interfaces - if it only listens on the loopback interface, you'll be able to connect via a 127.x.x.x ip but not an external ip. You can look at the "Network Utility" -> Netstat -> display state of all socket connections, which will display all open sockets. Further debugging will require the relevant lines from this (probably the one on port 8888) and potentially what webserver you're running...