def main():
parse_options()
http_server = tornado.httpserver.HTTPServer(Application(),xheaders=True)
print "Server started on port "+str(options.port)
http_server.bind(int(options.port), "0.0.0.0")# listen local only "127.0.0.1"
http_server.start(1)
tornado.ioloop.IOLoop.instance().start()
if __name__ == '__main__':
main()
僅供參考,可以綁定到0.0.0.0,就可以從外網存取了,IP就是主機位址
監聽0.0.0.0
監聽 0.0.0.0
Application的listen方法可以指定ip,例如