PySide6.QtWebSockets.QWebSocketProtocol

class QWebSocketProtocol

Contains constants related to the WebSocket standard. More

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

class Version

The different defined versions of the WebSocket protocol.

For an overview of the differences between the different protocols, see pywebsocket’s WebSocketProtocolSpec .

Constant

Description

QWebSocketProtocol.Version.VersionUnknown

Unknown or unspecified version.

QWebSocketProtocol.Version.Version0

hixie76 and hybi-00 . Works with key1, key2 and a key in the payload. Attribute: Sec-WebSocket-Draft value 0. Not supported by QtWebSockets .

QWebSocketProtocol.Version.Version4

hybi-04 . Changed handshake: key1, key2, key3 ==> Sec-WebSocket-Key, Sec-WebSocket-Nonce, Sec-WebSocket-Accept Sec-WebSocket-Draft renamed to Sec-WebSocket-Version Sec-WebSocket-Version = 4. Not supported by QtWebSockets .

QWebSocketProtocol.Version.Version5

hybi-05 . Sec-WebSocket-Version = 5 Removed Sec-WebSocket-Nonce Added Sec-WebSocket-Accept. Not supported by QtWebSockets .

QWebSocketProtocol.Version.Version6

Sec-WebSocket-Version = 6. Not supported by QtWebSockets .

QWebSocketProtocol.Version.Version7

hybi-07 . Sec-WebSocket-Version = 7. Not supported by QtWebSockets .

QWebSocketProtocol.Version.Version8

hybi-8, hybi-9, hybi-10, hybi-11 and hybi-12. Status codes 1005 and 1006 are added and all codes are now unsigned Internal error results in 1006. Not supported by QtWebSockets .

QWebSocketProtocol.Version.Version13

hybi-13, hybi14, hybi-15, hybi-16, hybi-17 and RFC 6455 . Sec-WebSocket-Version = 13 Status code 1004 is now reserved Added 1008, 1009 and 1010 Must support TLS Clarify multiple version support. Supported by QtWebSockets .

QWebSocketProtocol.Version.VersionLatest

Refers to the latest known version to QtWebSockets .

class CloseCode

The close codes supported by WebSockets V13

Constant

Description

QWebSocketProtocol.CloseCode.CloseCodeNormal

Normal closure

QWebSocketProtocol.CloseCode.CloseCodeGoingAway

Going away

QWebSocketProtocol.CloseCode.CloseCodeProtocolError

Protocol error

QWebSocketProtocol.CloseCode.CloseCodeDatatypeNotSupported

Unsupported data

QWebSocketProtocol.CloseCode.CloseCodeReserved1004

Reserved

QWebSocketProtocol.CloseCode.CloseCodeMissingStatusCode

No status received

QWebSocketProtocol.CloseCode.CloseCodeAbnormalDisconnection

Abnormal closure

QWebSocketProtocol.CloseCode.CloseCodeWrongDatatype

Invalid frame payload data

QWebSocketProtocol.CloseCode.CloseCodePolicyViolated

Policy violation

QWebSocketProtocol.CloseCode.CloseCodeTooMuchData

Message too big

QWebSocketProtocol.CloseCode.CloseCodeMissingExtension

Mandatory extension missing

QWebSocketProtocol.CloseCode.CloseCodeBadOperation

Internal server error

QWebSocketProtocol.CloseCode.CloseCodeTlsHandshakeFailed

TLS handshake failed

See also

close()