mirror of
https://github.com/pion/webrtc.git
synced 2025-12-24 11:51:03 +08:00
This PR adds a new simple -datachannel example to help newcomers understand how to create and test a basic WebRTC DataChannel using Go and a static HTML page (demo.html). - Includes main.go for signaling and WebRTC setup. - Includes demo.html to test sending/receiving messages. - Tested locally and works with the provided signaling server.
WebRTC DataChannel Example in Go
This is a minimal example of a WebRTC DataChannel using Go (Pion) as the signaling server.
Features
- Go server for signaling
- Browser-based DataChannel
- ICE candidate exchange
- Real-time messaging between browser and Go server
Usage
- Run the server:
go run main.go
-
Open browser at http://localhost:8080
-
Send messages via DataChannel and see them in terminal & browser logs.