flask-uwsgi-websocket
flask-uwsgi-websocket copied to clipboard
Is there a way to disable HTTP to only accept HTTPS?
We try to only use HTTPS in our dev environments (mkcert is helpful here) to avoid any issues when running in prod. So we'd like to disable the default HTTP listener on port 5000 so devs can't accidentally use HTTP. In dev, we launch uwsgi as follows
ws_app = GeventWebSocket(app)
ssl_cert = path.join(path.dirname(__file__), 'ssl.cert')
ssl_key = path.join(path.dirname(__file__), 'ssl.key')
app.run(https='0.0.0.0:5001,{},{}'.format(ssl_cert,ssl_key), gevent=100)`
It works, but maybe I'm cheating as I see no mention of https options in the source.
Is there a way to disable HTTP:5000 or maybe to add --http-to-https to the call?
Thanks