
Public Member Functions | |
| def | check_origin |
| def | on_close |
| def | on_message |
| def | open |
| def | send_message |
Public Attributes | |
| authenticated | |
| protocol | |
Static Public Attributes | |
| authenticate = False | |
| bson_only_mode = False | |
| int | client_id_seed = 0 |
| int | clients_connected = 0 |
| int | delay_between_messages = 0 |
| int | fragment_timeout = 600 |
| max_message_size = None | |
Definition at line 45 of file websocket_handler.py.
| def rosbridge_server.websocket_handler.RosbridgeWebSocket.check_origin | ( | self, | |
| origin | |||
| ) |
Override to enable support for allowing alternate origins.
The ``origin`` argument is the value of the ``Origin`` HTTP
header, the url responsible for initiating this request. This
method is not called for clients that do not send this header;
such requests are always allowed (because all browsers that
implement WebSockets support this header, and non-browser
clients do not have the same cross-site security concerns).
Should return True to accept the request or False to reject it.
By default, rejects all requests with an origin on a host other
than this one.
This is a security protection against cross site scripting attacks on
browsers, since WebSockets are allowed to bypass the usual same-origin
policies and don't use CORS headers.
To accept all cross-origin traffic (which was the default prior to
Tornado 4.0), simply override this method to always return true::
def check_origin(self, origin):
return True
To allow connections from any subdomain of your site, you might
do something like::
def check_origin(self, origin):
parsed_origin = urllib.parse.urlparse(origin)
return parsed_origin.netloc.endswith(".mydomain.com")
.. versionadded:: 4.0
Reimplemented from tornado.websocket.WebSocketHandler.
Definition at line 116 of file websocket_handler.py.
Invoked when the WebSocket is closed. If the connection was closed cleanly and a status code or reason phrase was supplied, these values will be available as the attributes ``self.close_code`` and ``self.close_reason``. .. versionchanged:: 4.0 Added ``close_code`` and ``close_reason`` attributes.
Reimplemented from tornado.websocket.WebSocketHandler.
Definition at line 106 of file websocket_handler.py.
| def rosbridge_server.websocket_handler.RosbridgeWebSocket.on_message | ( | self, | |
| message | |||
| ) |
Handle incoming messages on the WebSocket This method must be overridden.
Reimplemented from tornado.websocket.WebSocketHandler.
Definition at line 79 of file websocket_handler.py.
Invoked when a new WebSocket is opened. The arguments to `open` are extracted from the `tornado.web.URLSpec` regular expression, just like the arguments to `tornado.web.RequestHandler.get`.
Reimplemented from tornado.websocket.WebSocketHandler.
Definition at line 58 of file websocket_handler.py.
| def rosbridge_server.websocket_handler.RosbridgeWebSocket.send_message | ( | self, | |
| message | |||
| ) |
Definition at line 112 of file websocket_handler.py.
rosbridge_server::websocket_handler.RosbridgeWebSocket::authenticate = False [static] |
Definition at line 48 of file websocket_handler.py.
Definition at line 58 of file websocket_handler.py.
Definition at line 56 of file websocket_handler.py.
Definition at line 46 of file websocket_handler.py.
Definition at line 47 of file websocket_handler.py.
Definition at line 54 of file websocket_handler.py.
int rosbridge_server::websocket_handler.RosbridgeWebSocket::fragment_timeout = 600 [static] |
Definition at line 52 of file websocket_handler.py.
Definition at line 55 of file websocket_handler.py.
Definition at line 58 of file websocket_handler.py.