Skip to content

Instantly share code, notes, and snippets.

@val314159
Created January 13, 2015 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save val314159/7364b3810a8d54add809 to your computer and use it in GitHub Desktop.
Save val314159/7364b3810a8d54add809 to your computer and use it in GitHub Desktop.
bottle on top of gevent ssl WGSI server
#!/usr/bin/python
from gevent import monkey; monkey.patch_all()
import bottle
from bottle import route
@route('/qwert')
def qwert():
return ['qwert']
@route('/static/<filepath:path>')
def server_static(filepath):
return bottle.static_file(filepath, root='.')
return bottle.static_file(filepath, root='./static')
def launch_gevent_ssl():
from gevent import pywsgi
print 'Serving on https://0.0.0.0:8443'
server = pywsgi.WSGIServer(('0.0.0.0', 8443), bottle.default_app(),
keyfile='server.key', certfile='server.crt')
# server.start()
server.serve_forever()
pass
if __name__=='__main__': launch_gevent_ssl()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment