fix: preserve WebSocket frame type in plugin proxy (#594)

* fix: preserve WebSocket frame type in plugin proxy

The plugin WebSocket proxy relays all messages as binary frames
regardless of the original frame type. This causes text-based ready
messages to be forwarded as binary, so the browser never processes
them and plugin UIs (like web-terminal) show a spinner indefinitely.

Pass the isBinary flag through in both relay directions so the
original frame type is preserved.

Fixes CoderLuii/HolyClaude#11

* fix(plugins): preserve websocket frame type in proxy

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

---------

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
CoderLuii
2026-06-01 13:56:51 -04:00
committed by GitHub
parent 1e125f3db5
commit 36b860e322

View File

@@ -26,15 +26,15 @@ export function handlePluginWsProxy(
console.log(`[Plugins] WS proxy connected to "${pluginName}" on port ${port}`);
});
upstream.on('message', (data) => {
upstream.on('message', (data, isBinary) => {
if (clientWs.readyState === WebSocket.OPEN) {
clientWs.send(data);
clientWs.send(data, { binary: isBinary });
}
});
clientWs.on('message', (data) => {
clientWs.on('message', (data, isBinary) => {
if (upstream.readyState === WebSocket.OPEN) {
upstream.send(data);
upstream.send(data, { binary: isBinary });
}
});