HTTPs over Bottlepy and Gevent

What is the best way to insert HTTPs in this code? I need to use Bootlepy and Gevent, like this example. Thanks

from gevent import monkey; monkey.patch_all()

from time import sleep
from bottle import route, run

@route('/hello')
def hello():
    return "<html><body>hello</body></html>"

@route('/stream')
def stream():
    yield 'START'
    sleep(3)
    yield 'MIDDLE'
    sleep(5)
    yield 'END'

run(host='0.0.0.0', port=8080, server='gevent')

Answers


from gevent import pywsgi
import bottle

# Get bottle's WSGI callable
wsgi_app = bottle.default_app()

# Needs a generated SSL key and certificate to use.
server = pywsgi.WSGIServer(('0.0.0.0', 443), wsgi_app,
                           keyfile='server.key', certfile='server.crt')
server.serve_forever()

Need Your Help

JavaFX distance between two circle and keep updating property

text javafx properties distance

For assignment, I created 2 draggable circle and connect them with line with javaFX.