MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / proxyWebSocket

Function proxyWebSocket

scripts/mars-web-bridge.mjs:530–539  ·  view source on GitHub ↗
(req, socket, head, { sessionId, path })

Source from the content-addressed store, hash-verified

528 }
529
530 function proxyWebSocket(req, socket, head, { sessionId, path }) {
531 const target = upstreamFor(sessionId);
532 if (!target) {
533 socket.end("HTTP/1.1 409 Conflict\r\n\r\n");
534 return;
535 }
536 toUpstreamRequest(req, path);
537 track(socket);
538 proxy.proxyWebSocket(req, socket, head, target);
539 }
540
541 return {
542 /** The bridge in use, for the caller's own dispose() or tests. */

Callers 1

handleUpgradeFunction · 0.70

Calls 3

upstreamForFunction · 0.85
toUpstreamRequestFunction · 0.85
trackFunction · 0.70

Tested by

no test coverage detected