monkey.patch_all() function from gevent to implement
concurrency.I found many ways of implementing it using CherryPy module.
But I need to implement it without using CherryPy or any other module.
Is there any way to add TLS by using Bottle and Gevent?
Here is a sample code of what I tried.
server.py :
from bottle import route, run,request
from gevent import monkey; monkey.patch_all()
import time
valur = 0
@route('/hello/<name>', method = 'GET')
def index(name):
print valur
time.sleep(9)
return str(valur)
run(host='0.0.0.0', port=5000, reloader =False,interval=10, server='gevent')
private key and certificate file location in the
server we can enable TLS\SSL support to your server.The modified sorce code is given below,
run(host='0.0.0.0', port=5000, reloader =False,interval=10, server='gevent', certfile='server.crt', keyfile='server.key')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With