Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

43 строки
1.7KB

  1. import engineio
  2. class WSGIApp(engineio.WSGIApp):
  3. """WSGI middleware for Socket.IO.
  4. This middleware dispatches traffic to a Socket.IO application. It can also
  5. serve a list of static files to the client, or forward unrelated HTTP
  6. traffic to another WSGI application.
  7. :param socketio_app: The Socket.IO server. Must be an instance of the
  8. ``socketio.Server`` class.
  9. :param wsgi_app: The WSGI app that receives all other traffic.
  10. :param static_files: A dictionary with static file mapping rules. See the
  11. documentation for details on this argument.
  12. :param socketio_path: The endpoint where the Socket.IO application should
  13. be installed. The default value is appropriate for
  14. most cases.
  15. Example usage::
  16. import socketio
  17. import eventlet
  18. from . import wsgi_app
  19. sio = socketio.Server()
  20. app = socketio.WSGIApp(sio, wsgi_app)
  21. eventlet.wsgi.server(eventlet.listen(('', 8000)), app)
  22. """
  23. def __init__(self, socketio_app, wsgi_app=None, static_files=None,
  24. socketio_path='socket.io'):
  25. super(WSGIApp, self).__init__(socketio_app, wsgi_app,
  26. static_files=static_files,
  27. engineio_path=socketio_path)
  28. class Middleware(WSGIApp):
  29. """This class has been renamed to WSGIApp and is now deprecated."""
  30. def __init__(self, socketio_app, wsgi_app=None,
  31. socketio_path='socket.io'):
  32. super(Middleware, self).__init__(socketio_app, wsgi_app,
  33. socketio_path=socketio_path)