julian
julian

Reputation: 368

Why does python SimpleHTTPServer not work on localhost when there is no internet?

I ran python -m SimpleHTTPServer to create a web server session (on Windows 8). This works fine using http://127.0.0.1:8000 or http://localhost:8000 UNLESS there is no internet connection. When there is no internet the (Chrome) browser stays blank. How to make the local server work regardless of whether there is external internet connectivity? Is this a Windows specific issue?

Upvotes: 0

Views: 1467

Answers (1)

tsc_chazz
tsc_chazz

Reputation: 206

If this is what I think it is, you're testing by unplugging the network cable or turning off your wireless card.

When there is no network, in many Windows versions, the entire network stack, or at least the user space part of it, goes away.

You might hunt up a loopback adapter pseudo net card and install that, which will give you an always active network connection; I believe Microsoft did make one available for Windows 7 and earlier, but I haven't looked for it on Windows 8.

Upvotes: 4

Related Questions