Public Member Functions | Public Attributes | Static Public Attributes
rosbridge_server.websocket_handler.RosbridgeWebSocket Class Reference
Inheritance diagram for rosbridge_server.websocket_handler.RosbridgeWebSocket:
Inheritance graph
[legend]

List of all members.

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
int client_id_seed = 0
int clients_connected = 0

Detailed Description

Definition at line 46 of file websocket_handler.py.


Member Function Documentation

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 103 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 93 of file websocket_handler.py.

Handle incoming messages on the WebSocket

This method must be overridden.

Reimplemented from tornado.websocket.WebSocketHandler.

Definition at line 66 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 51 of file websocket_handler.py.

Definition at line 99 of file websocket_handler.py.


Member Data Documentation

Definition at line 49 of file websocket_handler.py.

Definition at line 51 of file websocket_handler.py.

Definition at line 47 of file websocket_handler.py.

Definition at line 48 of file websocket_handler.py.

Definition at line 51 of file websocket_handler.py.


The documentation for this class was generated from the following file:


rosbridge_server
Author(s): Jonathan Mace
autogenerated on Thu Aug 27 2015 14:50:40