quart.wrappers.websocket モジュール#

class quart.wrappers.websocket.Websocket(path: str, query_string: bytes, scheme: str, headers: Headers, root_path: str, http_version: str, subprotocols: list[str], receive: Callable, send: Callable, accept: Callable, close: Callable, scope: WebsocketScope)#

基底クラス: BaseRequestWebsocket

async accept(headers: dict | Headers | None = None, subprotocol: str | None = None) None#

WebSocket 接続を manuell に承諾します。

パラメータ:
  • headers – 承諾レスポンスと共に送信する追加ヘッダー。

  • subprotocol – 選択されたサブプロトコル(オプション)。

async close(code: int, reason: str = '') None#
async receive() AnyStr#
async receive_json() Any#
property requested_subprotocols: list[str]#
async send(data: AnyStr) None#
async send_json(*args: Any, **kwargs: Any) None#