In the given talk I cover interesting fact about the protocol which provides HTTP bidirectional communication. Starting with the past state of web sockets and their implementation I explain the protocol step by step, present my own stream based WebSocket implementation and compare it to present challengers. To the end I talk about my personal experience with WebSockets and how I predict the future of them.
5. Frame Encoding
1000 0001 0000 0101 0100 1000 0110 0101 0111 1001
PayloadHeader
H e y
F
I
N
R
S
V
OP
CODE
M
A
S
K
LENGTH
Extended Length Masking
6. WebSockets in node.js
socket.io by learn boost
fallback support, high level api (e.g. events)
!
ws by einaros
„fastest“ websocket implementation
7. Walve
- socket.io by learn boost
not working, using xhr fallback all the time, cannot read code for PR
!
- other ws implementations
awful API design, also bad to read
1. Follows node’s core conventions
2. Uses node’s TransformStreams
3. Written in readable JavaScript