Alex
Alex

Reputation: 3257

How to make python web server to respond on IP adress?

I am testing some python functionalities as web server. Typed :

$ python -m SimpleHTTPServer 8080

...and setup port forwarding on router to this 8080. I can access via web with http://my.ip.adr.ess:8080/, whereas my.ip.adr.ess stands for my IP adress.

When I started my xampp server it is accessible with http://my.ip.adr.ess/ and no 8080 port is required for accessing.

What should I have to do to python server responds like that?

Upvotes: 0

Views: 265

Answers (2)

falsetru
falsetru

Reputation: 369054

Specify the port as 80 (default port for HTTP protocol).

python -m SimpleHTTPServer 80

You may need superuser permission in Unix to bind port 80 (under 1024).

sudo python -m SimpleHTTPServer 80

Upvotes: 1

Paweł Piecyk
Paweł Piecyk

Reputation: 2789

It means that xampp is running on port 80 which is default for http://. You need to run SimpleHTTPServer on that port too. More info about running SimpleHTTPServer on port 80.

Upvotes: 2

Related Questions