socketio.handler

This is a lower-level transports handler. It is responsible for calling your WSGI application.

class socketio.handler.SocketIOHandler(config, *args, **kwargs)[source]

Bases: WSGIHandler

RE_DISCONNECT_URL = re.compile('\n        ^/(?P<resource>.+?)\n         /(?P<protocol_version>[^/]+)\n         //(?P<sessid>[^/]+)/?$\n         ', re.VERBOSE)
RE_HANDSHAKE_URL = re.compile('^/(?P<resource>.+?)/1/$', re.VERBOSE)
RE_REQUEST_URL = re.compile('\n        ^/(?P<resource>.+?)\n         /1\n         /(?P<transport_id>[^/]+)\n         /(?P<sessid>[^/]+)/?$\n         ', re.VERBOSE)
handle_bad_request()[source]
handle_disconnect_request()[source]
handle_one_response()[source]

This function deals with ONE INCOMING REQUEST from the web.

It will wire and exchange message to the queues for long-polling methods, otherwise, will stay alive for websockets.

handler_types = {'flashsocket': <class 'socketio.transports.FlashSocketTransport'>, 'htmlfile': <class 'socketio.transports.HTMLFileTransport'>, 'jsonp-polling': <class 'socketio.transports.JSONPolling'>, 'websocket': <class 'socketio.transports.WebsocketTransport'>, 'xhr-multipart': <class 'socketio.transports.XHRMultipartTransport'>, 'xhr-polling': <class 'socketio.transports.XHRPollingTransport'>}
write_jsonp_result(data, wrapper='0')[source]
write_plain_result(data)[source]
write_smart(data)[source]