Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comparing Server Sent Events, WebSocket, WebRTC, and WebTransport under packet loss

License

NotificationsYou must be signed in to change notification settings

pion/realtime-web-comparison

Repository files navigation

Experimenting with Server Sent Events, WebSocket, WebRTC, and WebTransport by streaming 2500 coordinates from server to client to visualize.

NOTE: This repository is currently in flux.

  • The WebTransport server currently does not work
  • We're doing our best to update all code to the latest versions of their dependencies.

Additional notes

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)    }}

TODO

Dependencies

Local testing

  1. Clone repo

    git clone https://github.com/pion/realtime-web-comparison.gitcd realtime-web-comparison
  2. Create locally trusted certs usingmkcert

    mkdir certs&&cd certsmkcert -installmkcert localhost

    If using Nix flakes (seeNix Setup Flakes section above):

    nix run .#setup-certs
  3. Run a server (use similar commands forwebtransport andwebrtc)

    ./run.sh websocket
  4. Simulating packet loss (usedel instead ofadd to remove rules)

    sudo tc qdisc add dev lo root netem loss 15%
  5. Run client

    ./run.sh clientchromium --origin-to-force-quic-on=localhost:8001 http://localhost:3000

Nix Setup

This repository includes a Nix flake for reproducible development environments. The flake provides all necessary dependencies including Rust, Go, OpenSSL, and mkcert.

Development Shell

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)

Setting Up Certificates

Use the Nix task to automatically set up locally trusted certificates:

nix run .#setup-certs

Thesetup-certs task will:

  • Create thecerts/ directory if it doesn't exist
  • Install the local CA certificate in your system trust store
  • Generate a certificate forlocalhost

Available Tasks

  • 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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp