python - How run bottle + tornado + ssl (https) + spdy -


i'm using python framework bottle webserver tornado. here's init.py:

import bottle import os  # init application bottle.run(host="127.0.0.1", app=app, port=int(os.environ.get("port", 5000)), server='tornado') 
  • how make connection via https?

i read article http://dgtool.blogspot.com/2011/12/ssl-encryption-in-python-bottle.html it's cherrypy server.


  • is posible use spdy tornado? how? (i found tornadospdy on github, there no explanations how use it)

any appreciated

your best bet use proxy front end server nginx, haproxy or apache. configuring tornado ssl extremely slow, slows tornado down crawl until becomes totally unresponsive minimal visits. have looked everywhere decent speed in ssl traffic using tornado directly, did not find any. besides not bad use front end server.

but using apache f.ex. front end proxy, got close native non-ssl speeds.

but configure tornado ssl, simple :

def main():     handlers = [         (r"/", homehandler),     ]     settings = dict(        blog_title=u"tornado blog",         template_path=os.path.join(os.path.dirname(__file__), "templates"),         static_path=os.path.join(os.path.dirname(__file__), "static"),         cookie_secret="__todo:_generate_your_own_random_value_here__",         debug=true,         certfile = os.path.join("certs/server.crt"),         keyfile = os.path.join("certs/server.key"),         ssl_options = {             "certfile" : os.path.join("certs/server.crt"),             "keyfile" : os.path.join("certs/server.key"),         },     )     tornado.options.parse_command_line()     http_server = tornado.httpserver.httpserver(application())     http_server.listen(options.port)     tornado.ioloop.ioloop.instance().start()  main() 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -