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,比如