A simple WebRTC chat room application.
Noah Petherbridge
3f756c5318
* Two users can activate their cameras locally and then connect them together with WebRTC with video and audio support working! * Limitation: users need to be broadcasting video themselves before they can connect to someone's camera. If the offerer doesn't add tracks of their own, the SDP offer doesn't request video channels; so even though the answerer adds their tracks to the connection, they aren't used by the offerer. * As currently implemented, the offerer's camera feed will also appear on screen for the answerer - every video connection opens the feed both ways. Compared to the previous commit (where clients shared SDP messages but not ICE candidates or anything further) the fixes and learnings were: * The back-end was trying to relay candidate messages, but there was a JSON marshalling error (json object casted into a string) - changed the Message type to map[string]interface{} and both sides could exchange ICE candidates. * Both sides needed to add their video tracks to the connection so that there was anything of value to be sent over the WebRTC channel. Other changes: * Server will send a ping message every minute to connected WebSockets. |
||
---|---|---|
cmd/BareRTC | ||
pkg | ||
web | ||
go.mod | ||
go.sum | ||
LICENSE | ||
Makefile | ||
README.md |
BareRTC
BareRTC is a simple WebRTC-based chat room application. It is especially designed to be plugged into any existing website, with or without a pre-existing base of users.
Features
Planned features:
- One common group chat area where all participants can broadcast text messages.
- Direct (one-on-one) text conversations between any two users.
- Simple integration with your pre-existing userbase via signed JWT tokens.
Configuration
TBD
Authentication
BareRTC supports custom (user-defined) authentication with your app in the form of JSON Web Tokens (JWTs). Configure a shared Secret Key in the ChatRTC settings and have your app create a signed JWT with the same key and the following custom claims:
{
"username": "Soandso",
"icon": "https://path/to/square/icon.png",
"admin": false,
}
License
GPLv3.