Skip to content

Commit b45c270

Browse files
committed
websockify: additional comments on async, rewrite
1 parent 364a9d1 commit b45c270

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

jupyter_server_proxy/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def cats_only(response, path):
291291
Proxy websocket requests as a TCP (or unix socket) stream.
292292
In this mode, only websockets are handled, and messages are sent to the backend,
293293
equivalent to running a websockify layer (https://github.com/novnc/websockify).
294-
All other HTTP requests return 405.
294+
All other HTTP requests return 405 (and thus this will also bypass rewrite_response).
295295
""",
296296
config=True,
297297
)

jupyter_server_proxy/websockify.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def __init__(self, handler):
2222
def data_received(self, data):
2323
"Send the buffer as a websocket message."
2424
self.handler._record_activity()
25-
self.handler.write_message(data, binary=True) # async, no wait
25+
# async "semi-synchronous", waiting is only needed for control flow and errors:
26+
self.handler.write_message(data, binary=True)
2627

2728
def connection_lost(self, exc):
2829
"Close the websocket connection."

0 commit comments

Comments
 (0)