- Notifications
You must be signed in to change notification settings - Fork0
Comparing Server Sent Events, WebSocket, WebRTC, and WebTransport under packet loss
License
pion/realtime-web-comparison
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Experimenting with Server Sent Events, WebSocket, WebRTC, and WebTransport by streaming 2500 coordinates from server to client to visualize.
- The WebTransport server currently does not work
- We're doing our best to update all code to the latest versions of their dependencies.
Original code for this repository was derived fromhttps://github.com/Sh3b0/realtime-web
UDP Receive buffer size was incremented as suggested inhttps://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size
No limits were specified on packet size or how protocols buffer packets.
The pseudo code of what each test is doing looks somewhat like this:
fori:=10;i<510;i+=10 {forj:=10;j<510;j+=10 {message:=fmt.Sprintf("%d,%d",j,i)iferr:=conn.WriteMessage(websocket.TextMessage, []byte(message));err!=nil {log.Fatal(err) }time.Sleep(1*time.Millisecond) }}
- Add more options for each network connection type
- Add more libraries to test.
- Server Sent Events
- WebSockets
- WebRTC
- WebTransport
- Client is written in pure HTML/CSS/JS.
Clone repo
git clone https://github.com/pion/realtime-web-comparison.gitcd realtime-web-comparisonCreate locally trusted certs usingmkcert
mkdir certs&&cd certsmkcert -installmkcert localhost
If using Nix flakes (seeNix Setup Flakes section above):
nix run .#setup-certsRun a server (use similar commands for
webtransportandwebrtc)./run.sh websocket
Simulating packet loss (use
delinstead ofaddto remove rules)sudo tc qdisc add dev lo root netem loss 15%
Run client
./run.sh clientchromium --origin-to-force-quic-on=localhost:8001 http://localhost:3000
This repository includes a Nix flake for reproducible development environments. The flake provides all necessary dependencies including Rust, Go, OpenSSL, and mkcert.
Enter the development shell to get all tools in your PATH:
nix develop
This provides:
- Rust toolchain (rustc, cargo, rustfmt, clippy, rust-analyzer)
- Go toolchain
- OpenSSL with proper environment variables configured
- mkcert for certificate generation
- NSS tools (for Firefox support on Linux)
Use the Nix task to automatically set up locally trusted certificates:
nix run .#setup-certsThesetup-certs task will:
- Create the
certs/directory if it doesn't exist - Install the local CA certificate in your system trust store
- Generate a certificate for
localhost
nix run .#setup-certs- Set up development certificates using mkcert
Note: you might need to runnix develop -c mkcert -install and restart your browsers.
About
Comparing Server Sent Events, WebSocket, WebRTC, and WebTransport under packet loss
Topics
Resources
License
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Contributors3
Uh oh!
There was an error while loading.Please reload this page.