redirect all http traffic to https

74 views
Skip to first unread message

Ashutosh Kumar

unread,
Mar 30, 2020, 12:38:13 PM3/30/20
to gevent: coroutine-based Python network library
Hi,

I need help in this.

For now if someone access my application using https:\\ things are working fine but is there anything that can help me to redirect http connection to https:\\

Code snippet for better understanding.

from search_app import app
from gevent.pywsgi import WSGIServer
import os


if __name__ == '__main__':
    http_server = WSGIServer(('127.0.0.1', 5000), app, keyfile=f'{os.path.dirname(app.instance_path)}\\private.key', certfile=f'{os.path.dirname(app.instance_path)}\\tredence.crt')
    http_server.serve_forever()


Thanks.
Reply all
Reply to author
Forward
0 new messages