MCPcopy Index your code
hub / github.com/python-websockets/websockets / build_subprotocol

Function build_subprotocol

src/websockets/headers.py:458–465  ·  view source on GitHub ↗

Build a ``Sec-WebSocket-Protocol`` header. This is the reverse of :func:`parse_subprotocol`.

(subprotocols: Sequence[Subprotocol])

Source from the content-addressed store, hash-verified

456
457
458def build_subprotocol(subprotocols: Sequence[Subprotocol]) -> str:
459 """
460 Build a ``Sec-WebSocket-Protocol`` header.
461
462 This is the reverse of :func:`parse_subprotocol`.
463
464 """
465 return ", ".join(subprotocols)
466
467
468build_subprotocol_list = build_subprotocol # alias for backwards compatibility

Callers 3

connectMethod · 0.85
handshakeMethod · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…