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

Function parse_subprotocol

src/websockets/headers.py:442–452  ·  view source on GitHub ↗

Parse a ``Sec-WebSocket-Protocol`` header. Return a list of WebSocket subprotocols. Raises: InvalidHeaderFormat: On invalid inputs.

(header: str)

Source from the content-addressed store, hash-verified

440
441
442def parse_subprotocol(header: str) -> list[Subprotocol]:
443 """
444 Parse a ``Sec-WebSocket-Protocol`` header.
445
446 Return a list of WebSocket subprotocols.
447
448 Raises:
449 InvalidHeaderFormat: On invalid inputs.
450
451 """
452 return parse_list(parse_subprotocol_item, header, 0, "Sec-WebSocket-Protocol")
453
454
455parse_subprotocol_list = parse_subprotocol # alias for backwards compatibility

Callers 6

process_subprotocolMethod · 0.85
process_subprotocolMethod · 0.85
process_subprotocolMethod · 0.85
process_subprotocolMethod · 0.85

Calls 1

parse_listFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…