- WebSockets are awesome
- We should use WebSockets on the server
- Browsers without WebSockets should be transparently upgraded (use same WebSocket client code and WebSocket server)
- Networks where WebSockets are not the most network-efficient transport should transparently emulate a WebSocket
- Scaling a server should be thinking only about managing long-lived WebSocket connections
- Developer happiness is desired
- Operational happiness is desired
- Cookies are desired
PolySocket is both a WebSocket shim and a ShimmedWebSocket relay server (to produce pure WebSockets).
The PolySocketRelay server accepts non-WebSocket duplex streams, and forwards them to a target server translated into a pure WebSocket connection.
Scaling the hacks of xhr-streaming, json-polling, etc... are difficult to do while also scaling your application. By separating these ShimmedWebSocket hacks to a central location (the PolySocketRelay), it is easier to scale the Relay on its own as needed and the backend WebSocket application on its own as needed.
new PolySocket with