Closed
Description
Specification
The websockets domain in Polykey can be extracted out in order to be re-used inside PKE.
Initial usage will just wrap around ws
. So no runtimeless support yet. We would later extract the functionality of ws
to have runtimeless support.
Proper runtimeless support would need to support TLS too. This is also where we can investigate how to unify the TLS between all the IO libraries. It's possible that the entire state machine can be done in pure JS without involving Rust/C++, it might be fast enough. Doing this would a be separate thing.
Additional context
- WebSocket Behaviour Alignment with Transport Layer #3
- Unifying the TLS libraries between WS, QUIC and Fetch/HTTPS Polykey#526
- Investigations into a Random Read and Random Write State Substrate for Keynodes Polykey#2
Tasks
- Extract out
src/websockets
to js-ws - Implement the
WebSocketStream
muxing/demuxing on top ofWebSocket
connection - Ensure that library works in browser and also on nodejs.
- Plan out the roadmap to support runtimeless operation (without
ws
) - Plan out the roadmap for unified TLS support - assuming runtimeless state machine is pure JS, then TLS operations would have to be exposed via JS routines too (this is necessary to support WSS)