http - Simple HTTPServer in Python with Static IP-Adresses in LAN does not work even after allowing Port-Rules under Windows 10 -
i want write simple httpserver program, have following code this:
import simplehttpserver import socketserver basehttpserver import basehttprequesthandler,httpserver port_number = 8080 #this class handles incoming request #the browser class myhandler(basehttprequesthandler): #handler requests def do_get(self): self.send_response(200) self.send_header('content-type','text/html') self.end_headers() # send html message self.wfile.write("hello world !") return try: #create web server , define handler manage #incoming request server = httpserver(('0.0.0.0', port_number), myhandler) print 'started httpserver on port ' , port_number #wait forever incoming htto requests server.serve_forever() except keyboardinterrupt: print '^c received, shutting down web server' server.socket.close()
the code executes fine , when openning 127.0.0.1:8080 greeted correct message "hello world".
however want connect outside, conention error when doing so.
i tried several steps turning off windows firewall, , making new port rules. not quite sure if there have specific rules in , out, , kinda guessed (allowed in lan on tcp , available ip-adresses) - did in , out.
i tried give ip-adress directly, instead of 0.0.0.0
used static ip adress 1xx.xx.xx.xxx greeted with:
[errno 10049] requested address invalid in context
is there simple , safe solution problem?
Comments
Post a Comment