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

Function handler

tests/sync/server.py:18–30  ·  view source on GitHub ↗
(ws)

Source from the content-addressed store, hash-verified

16
17
18def handler(ws):
19 path = urllib.parse.urlparse(ws.request.path).path
20 if path == "/":
21 # The default path is an eval shell.
22 for expr in ws:
23 value = eval(expr)
24 ws.send(str(value))
25 elif path == "/crash":
26 raise RuntimeError
27 elif path == "/no-op":
28 pass
29 else:
30 raise AssertionError(f"unexpected path: {path}")
31
32
33class EvalShellMixin:

Callers 1

conn_handlerFunction · 0.50

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…