Map

Pion Handoff

Toolbox toolboxgolangwebrtcnetworkingGoMIT โ†ณ show in map Markdown
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

  1. Browser loads the target website and authenticates normally
  2. Website initiates WebRTC signaling (offer/answer exchange)
  3. A userscript (Greasemonkey) intercepts RTCPeerConnection in the browser, mocking the API
  4. Signaling is forwarded to the Handoff backend
  5. 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 override
  • media-save โ€” records VP8 video backend-side while displaying in browser
  • media-send โ€” forwards VP8 RTP from backend into the browser session
  • greasemonkey โ€” auto-generates userscripts for RTCPeerConnection interception

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