Watch the wire: real-time web protocols

Five ways to move data in real time. SSE and WebSockets keep a connection open between a browser and a server. SIP and WebRTC set up calls, and RTP carries the audio and video once a call is up. Press the buttons, watch what travels, and click messages to read them in full.

Speed

Browser

readyStateno EventSource
Last-Event-IDnone
No connection
Separate HTTP request (only when the client sends data)

Server

Last event id0
Event historyempty
HTTP requests made: 0 Long-lived connections open: 0

Nothing is connected yet. Press Connect to create an EventSource and open the stream.

Browser

Server

Network

On the wire

Raw HTTP and event-stream text

Traffic will appear here.

What your JavaScript sees

EventSource events and handlers

Events will appear here.

This is a simulation for learning. Timings are slowed down a lot (real audio sends 50 RTP packets per second), frame and message details are simplified, and real WebSocket frames are binary but are shown here as readable descriptions. Addresses are from the ranges reserved for documentation.