3 ms·
Update: I've now implemented a small PoC with ID negotation, you can see it here: https://gist.github.com/TimonLukas/c0bb7e8f9bde9d3d74d6b776b5abdb72 https://gi
by Timon3 3y ago
Update: I've now implemented a small PoC with ID negotation, you can see it here: https://gist.github.com/TimonLukas/c0bb7e8f9bde9d3d74d6b776b5abdb72 https://gist.github.com/TimonLukas/c0bb7e8f9bde9d3d74d6b776b...
This will reduce message size quite a bit, since the data isn't sent as:
{ "id": 3, "method": "subscription.stop" }
but instead as:
[3,1]
- Timon3 3y agoUpdate: I've implemented a simple TS library around this: https://github.com/TimonLukas/ts-websocket-compressor https://github.com/TimonLukas/ts-websocket-compressor I will add wrappers for WebSocket/WebSocketServer in the future to allow using this without the library having to support it, like in the PoC with trpc.