examples/data-channels-whip-whep-like/README.md
This example demonstrates a WHIP/WHEP-like implementation using Pion WebRTC with DataChannel support for real-time chat.
Note: This is similar to but not exactly WHIP/WHEP, as the official WHIP/WHEP specifications focus on media streaming only and do not include DataChannel support. This example extends the WHIP/WHEP pattern to demonstrate peer-to-peer chat functionality with automatic username assignment and message broadcasting.
Key features:
Further details about WHIP+WHEP and the WebRTC DataChannel implementation are below the instructions.
This example requires you to clone the repo since it is serving static HTML.
git clone https://github.com/pion/webrtc.git
cd webrtc/examples/data-channels-whip-whep-like
Execute go run *.go
Congrats, you have used Pion WebRTC! Now start building something cool
This example uses a WHIP/WHEP-like signaling approach where an Offer is uploaded via HTTP and the server responds with an Answer. This simple API contract makes it easy to integrate WebRTC into web applications.
Difference from standard WHIP/WHEP: The official WHIP/WHEP specifications are designed for media streaming (audio/video) only. This example extends that pattern to include DataChannel support for real-time chat functionality.
Each connected user is automatically assigned a unique username combining:
Congrats, you have used Pion WebRTC! Now start building something cool
WHIP/WHEP mandates that a Offer is uploaded via HTTP. The server responds with a Answer. With this strong API contract WebRTC support can be added to tools like OBS.
For more info on WHIP/WHEP specification, feel free to read some of these great resources: