Reputation: 11008
I would like to see the Hello World!
string of the following python file from my external ip address when anyone on the internet would type in my external ip in the url bar.
#!/usr/bin/env python
from wsgiref.simple_server import make_server
cont = '''Hello world!'''
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return [cont]
server = make_server('0.0.0.0', 8080, application)
server.serve_forever()
Just typing in my external ip address in my browser's url bar doesn't work. Changing the 0.0.0.0 with my external ip does not work either. How do I do this?
(BTW: The script works when I go to my internal ip address in my browser)
Upvotes: 0
Views: 347
Reputation: 88977
I would guess that you are being a router that is doing Network Address Translation (NAT), and so you need to port forward in order to allow an outside machine to connect to your server.
It is also possible you are running a firewall which is blocking inbound requests.
It is also possible that your ISP blocks inbound requests on that port. You can check that easily using an online tool.
Upvotes: 1