http_websocket.py 842 B

123456789101112131415161718192021222324252627282930313233343536
  1. """WebSocket protocol versions 13 and 8."""
  2. from ._websocket.helpers import WS_KEY, ws_ext_gen, ws_ext_parse
  3. from ._websocket.models import (
  4. WS_CLOSED_MESSAGE,
  5. WS_CLOSING_MESSAGE,
  6. WebSocketError,
  7. WSCloseCode,
  8. WSHandshakeError,
  9. WSMessage,
  10. WSMsgType,
  11. )
  12. from ._websocket.reader import WebSocketReader
  13. from ._websocket.writer import WebSocketWriter
  14. # Messages that the WebSocketResponse.receive needs to handle internally
  15. _INTERNAL_RECEIVE_TYPES = frozenset(
  16. (WSMsgType.CLOSE, WSMsgType.CLOSING, WSMsgType.PING, WSMsgType.PONG)
  17. )
  18. __all__ = (
  19. "WS_CLOSED_MESSAGE",
  20. "WS_CLOSING_MESSAGE",
  21. "WS_KEY",
  22. "WebSocketReader",
  23. "WebSocketWriter",
  24. "WSMessage",
  25. "WebSocketError",
  26. "WSMsgType",
  27. "WSCloseCode",
  28. "ws_ext_gen",
  29. "ws_ext_parse",
  30. "WSHandshakeError",
  31. "WSMessage",
  32. )