MCPcopy Create free account
hub / github.com/python-websockets/websockets / build_response

Function build_response

src/websockets/legacy/handshake.py:101–114  ·  view source on GitHub ↗

Build a handshake response to send to the client. Update response headers passed in argument. Args: headers: Handshake response headers. key: Returned by :func:`check_request`.

(headers: Headers, key: str)

Source from the content-addressed store, hash-verified

99
100
101def build_response(headers: Headers, key: str) -> None:
102 """
103 Build a handshake response to send to the client.
104
105 Update response headers passed in argument.
106
107 Args:
108 headers: Handshake response headers.
109 key: Returned by :func:`check_request`.
110
111 """
112 headers["Upgrade"] = "websocket"
113 headers["Connection"] = "Upgrade"
114 headers["Sec-WebSocket-Accept"] = accept(key)
115
116
117def check_response(headers: Headers, key: str) -> None:

Callers 5

wrong_build_responseMethod · 0.90
handshakeMethod · 0.85
test_round_tripMethod · 0.85

Calls

no outgoing calls

Tested by 4

wrong_build_responseMethod · 0.72
test_round_tripMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…