3 ms·
> why to have thousands of connections instead of a single one (or a bunch) that simply forwards websocket packets with some "connection id" For anyone wanting
by jkarneges 6y ago
> why to have thousands of connections instead of a single one (or a bunch) that simply forwards websocket packets with some "connection id"
For anyone wanting to do this sort of thing, check out Pushpin [1]. It's a proxy server that can manage raw WebSocket connections on behalf of any HTTP backend. There are middleware libraries (such as [2]) to make it easy to write handler code.
Disclosure: lead dev. Came up with the idea after developing a custom connection manager thing at a previous company.
[1] https://pushpin.org https://pushpin.org
[2] https://github.com/fanout/js-serve-grip/blob/master/examples/express-ws/server.js https://github.com/fanout/js-serve-grip/blob/master/examples...