Pion Handoff
- title
- Pion Handoff
- type
- toolbox
- summary
- Starts a WebRTC session in the browser, then moves the real media connection to a Go backend
- tags
- golang, webrtc, networking
- language
- Go
- license
- MIT
- created
- 2026-04-07
- updated
- 2026-04-07
Start a WebRTC session in the browser, then hand the actual media connection off to a backend Go process. The browser authenticates and initiates signaling normally, but the WebRTC API is intercepted โ signaling forwards to Handoff, which establishes the real peer connection server-side using Pion.
How it works
- Browser loads the target website and authenticates normally
- Website initiates WebRTC signaling (offer/answer exchange)
- A userscript (Greasemonkey) intercepts
RTCPeerConnectionin the browser, mocking the API - Signaling is forwarded to the Handoff backend
- Handoff creates the actual WebRTC session with the remote peer using Pion's Go WebRTC stack
The browser thinks it's running a normal WebRTC call. The remote peer thinks it's talking to a browser. The actual media flows through your backend.
Use cases
Record โ join a video call and capture media server-side as raw RTP. No screen recording, no browser limitations โ you get the actual media streams as they arrive.
Send โ inject external video into a call. Pipe FFmpeg output, camera feeds, or generated video into the connection. The remote peer sees it as normal browser video, but you control the source.
Reverse engineer โ tap raw ICE, DTLS, RTP, RTCP, and SCTP traffic for protocol analysis and debugging. Useful for understanding how a particular WebRTC service behaves at the wire level.
Examples
datachannelโ basic data channel page with optional overridemedia-saveโ records VP8 video backend-side while displaying in browsermedia-sendโ forwards VP8 RTP from backend into the browser sessiongreasemonkeyโ auto-generates userscripts forRTCPeerConnectioninterception
Context
Built by Sean DuBois, creator of Pion (the Go WebRTC stack). This is a thin orchestration layer on top of existing Pion libraries โ the WebRTC foundations are mature even though Handoff itself is early (15 commits, single contributor). Go 59%, JavaScript 41%.
70 stars, MIT license. Repo: https://github.com/pion/handoff