Skip to content

octoprint.vendor.sockjs.tornado.router#

SockJSRouter(connection, prefix = '', user_settings = {}, io_loop = None, session_kls = None) #

Bases: object

SockJS protocol router

Constructor.

connection SockJSConnection class prefix Connection prefix user_settings Settings dictionary io_loop Optional IOLoop instance

urls property #

List of the URLs to be added to the Tornado application

apply_routes(routes) #

Feed list of the URLs to the routes list. Returns list

broadcast(clients, msg) #

Optimized broadcast implementation. Depending on type of the session, will json-encode message once and will call either send_message or send_jsonifed.

clients Clients iterable msg Message to send

create_session(session_id, register = True) #

Creates new session object and returns it.

request Request that created the session. Will be used to get query string parameters and cookies register Should be session registered in a storage. Websockets don't need it.

get_connection_class() #

Return associated connection class

get_session(session_id) #

Get session by session id

session_id Session id