Reputation: 667
I was wondering if I have index.html and in windows CMD run python -m http.server 80
while in the directory with index.html will it start a server on my IP(given I have port 80 open) and then people can just connect to my IP and see what is in index.html?
Upvotes: 0
Views: 843
Reputation: 683
If
Then it will be publically accessible. To make it only available on local host you should host on 127.0.0.1
httpd = ServerClass(("127.0.0.1", 80), HandlerClass)
Edit: the other answer posted this good link, didn't see until after posting: Is it possible to run python SimpleHTTPServer on localhost only?
Upvotes: 1
Reputation: 11
People should be able to connect to your public IP without problem. It would be a little more complex if you want to give access only from localhost:
Is it possible to run python SimpleHTTPServer on localhost only?
Upvotes: 0