How to run python-socketio (eventlet WSGI server) over HTTPS
<p>I want to run the following eventlet WSGI server over HTTPS. I am trying to connect to the python server from JavaScript on my HTTPS enabled web-server. </p>

<p><strong>I would like the answer to describe how I would change this code below to work with HTTPS.</strong></p>

<pre><code>import socketio
import eventlet
import eventlet.wsgi
from flask import Flask, render_template

sio = socketio.Server()
app = Flask(__name__)

@app.route('/')
def index():
    """Serve the client-side application."""
    return render_template('index.html')

@sio.on('connect', namespace='/chat')
    def connect(sid, environ):
    print("connect ", sid)

@sio.on('chat message', namespace='/chat')
def message(sid, data):
    print("message ", data)
    sio.emit('reply', room=sid)

@sio.on('disconnect', namespace='/chat')
def disconnect(sid):
    print('disconnect ', sid)

if __name__ == '__main__':
    # wrap Flask application with engineio's middleware
    app = socketio.Middleware(sio, app)

    # deploy as an eventlet WSGI server
    eventlet.wsgi.server(eventlet.listen(('', 8000)), app)
</code></pre>

<p>This code was take from <a href="https://pypi.python.org/pypi/python-socketio" rel="nofollow">here</a></p>

<p>To run a Evenlet WSGI server over HTTPS all thatâs needed is to pass an SSL-wrapped socket to the server() method like so:</p>

<pre><code>wsgi.server(eventlet.wrap_ssl(eventlet.listen(('', 8000)),
                          certfile='cert.crt',
                          keyfile='private.key',
                          server_side=True),
        app)
</code></pre>

python socket.io