autobahn.websocket.types¶
Exceptions¶
Throw an instance of this class to deny a WebSocket connection |
Classes¶
Thin-wrapper for WebSocket connection request information provided in |
|
Used by WebSocket servers to accept an incoming WebSocket connection. |
|
Thin-wrapper for WebSocket connection request information provided in |
|
Thin-wrapper for WebSocket connection response information provided in |
|
An incoming WebSocket message. |
|
Abstract base class for WebSocket messages. |
|
An outgoing WebSocket message. |
|
A WebSocket ping message. |
Module Contents¶
- class ConnectingRequest(host=None, port=None, resource=None, headers=None, useragent=None, origin=None, protocols=None)[source]¶
Bases:
objectThin-wrapper for WebSocket connection request information provided in
autobahn.websocket.protocol.WebSocketClientProtocol.onConnecting()after a client has connected, but before the handshake has proceeded.host, port, and resource are all required, everything else is optional. Note that these are values that will be seen by the client and should represent the public-facing host, port and resource to which the client is connecting (not necessarily the action host/port being used).
- class ConnectionAccept(subprotocol=None, headers=None)[source]¶
Bases:
objectUsed by WebSocket servers to accept an incoming WebSocket connection. If the client announced one or multiple subprotocols, the server MUST select one of the subprotocols announced by the client.
- exception ConnectionDeny(code, reason=None)[source]¶
Bases:
ExceptionThrow an instance of this class to deny a WebSocket connection during handshake in
autobahn.websocket.protocol.WebSocketServerProtocol.onConnect().- FORBIDDEN = 403[source]¶
Forbidden. The request was a legal request, but the server is refusing to respond to it.[2] Unlike a 401 Unauthorized response, authenticating will make no difference.
- INTERNAL_SERVER_ERROR = 500[source]¶
Internal Server Error. A generic error message, given when no more specific message is suitable.
- NOT_ACCEPTABLE = 406[source]¶
Not Acceptable. The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.
- NOT_FOUND = 404[source]¶
Not Found. The requested resource could not be found but may be available again in the future.[2] Subsequent requests by the client are permissible.
- NOT_IMPLEMENTED = 501[source]¶
Not Implemented. The server either does not recognize the request method, or it lacks the ability to fulfill the request.
- REQUEST_TIMEOUT = 408[source]¶
‘The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.
- Type:
Request Timeout. The server timed out waiting for the request. According to W3 HTTP specifications
- class ConnectionRequest(peer, headers, host, path, params, version, origin, protocols, extensions)[source]¶
Bases:
objectThin-wrapper for WebSocket connection request information provided in
autobahn.websocket.protocol.WebSocketServerProtocol.onConnect()when a WebSocket client want to establish a connection to a WebSocket server.
- class ConnectionResponse(peer, headers, version, protocol, extensions)[source]¶
Bases:
objectThin-wrapper for WebSocket connection response information provided in
autobahn.websocket.protocol.WebSocketClientProtocol.onConnect()when a WebSocket server has accepted a connection request by a client.
- class IncomingMessage(payload, is_binary=False)[source]¶
Bases:
MessageAn incoming WebSocket message.