class engineio.WSGIApp(engineio_app, wsgi_app=None, static_files=None, engineio_path='engine.io')

WSGI application middleware for Engine.IO.

This middleware dispatches traffic to an Engine.IO application. It can also serve a list of static files to the client, or forward unrelated HTTP traffic to another WSGI application.

Parameters:
  • engineio_app – The Engine.IO server. Must be an instance of the engineio.Server class.

  • wsgi_app – The WSGI app that receives all other traffic.

  • static_files – A dictionary with static file mapping rules. See the documentation for details on this argument.

  • engineio_path – The endpoint where the Engine.IO application should be installed. The default value is appropriate for most cases.

Example usage:

import engineio
import eventlet

eio = engineio.Server()
app = engineio.WSGIApp(eio, static_files={
    '/': {'content_type': 'text/html', 'filename': 'index.html'},
    '/index.html': {'content_type': 'text/html',
                    'filename': 'index.html'},
})
eventlet.wsgi.server(eventlet.listen(('', 8000)), app)