Skip to content

A WebRTC experiment to host peer to peer conferences written in Go!

Notifications You must be signed in to change notification settings


Folders and files

Last commit message
Last commit date

Latest commit



5 Commits

Repository files navigation


This is a tiny and lightweight experiment to easily host live video conferences using the WebRTC protocol.

The demo server at should only be used for testing purposes and could be down at any time.

Since I love simple things, this tiny server is written in Go, final binary weights ~10mb, uses ~8mb of memory and provides:

  • A STUN/TURN server using the pion/turn package that will forward streams if two peers cannot communicate directly,
  • A websocket signaling server to create rooms and enables anyone in the same room to communicate using the WebRTC protocol,
  • A tiny frontpage served by the server.

With the above stuff, you have everything you need to make peer to peer communications with WebRTC 💪


Once you have the Go language installed, just launch the server:

$ go run cmd/server/main.go -debug

It will download dependencies and run the tiny server straigh away (see the list of available options below).


$ go build -o rtchat cmd/server/main.go


This repository contains a Dockerfile to easily deploy this application (you must set environment variables TURN_PORT and TURN_IP). The final image weight about ~17mb 😍

$ docker build -t rtchat .
$ docker run -it --rm -p 5000:5000 -p 3478:3478/udp -e TURN_PORT=3478 -e TURN_IP= rtchat


Usage of rtchat:
        Should we launch in the debug mode?
  -http-port int
        Web server listening port. (default 5000)
  -realm string
        Realm used by the turn server. (default "")
  -turn-ip string
        IP Address that TURN can be contacted on. Should be publicly available. (default "")
  -turn-port int
        Listening port for the TURN/STUN endpoint. (default 3478)

If there is one parameter to keep in mind, it's the -turn-ip which represents the publicly available IP used by the TURN server to enables peer to communicate being NAT or proxys by forwarding all streams through the server.


A WebRTC experiment to host peer to peer conferences written in Go!







No releases published