Setting Up a WebRTC Signaling Server for Lobe Chat Data Sync #3192
Replies: 2 comments 4 replies
-
If I use deploy to vercel, what method should I use? |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the guide! A question about the I have a slightly modified set up using docker-compose labels as my Traefik static config already has websecure and web entrypoints for all containers and some predefined TLS providers. I'm getting a 404 when I hit signaling-lobe.{MY_DOMAIN} but no issues with http://{LOCAL_SERVER_IP}:4444. My labels are as follows:
Looking at the difference between your instructions above my guess is I need to define 2 services (one for http and one for ws), and set up host rules for them both? |
Beta Was this translation helpful? Give feedback.
-
This guide will walk you through the process of setting up a self-hosted WebRTC signaling server behind Traefik for Lobe Chat data synchronization. Special thanks to community members dazzle, arvinxu, and cy948 for their contributions to this guide and for making this sync option possible.
Setting Up the WebRTC Signaling Server
Enable WebRTC sync Flag in your lobe chat container with
FEATURE_FLAGS: "+webrtc_sync"
environment variable.Clone the signaling server repository to your machine:
Note: Remember this path as you'll need to point your Docker to use this folder.
Add a signaling service as a separate container:
or inside your current
docker-compose.yml
here is my compose file:Run your containers using
docker compose up -d
or your preferred method.Verify the server is working by accessing
{server_ip}:4444
in your browser. You should see a confirmation message.In the Lobe Chat UI, go to Sync settings and add your signaling server IP (e.g.,
http://{server_ip}:4444
).This setup should work if you're using Lobe Chat locally without TLS/HTTPS.
Note
The following sections assume you're using Traefik as a reverse proxy and Cloudflare for DNS and certificate management.
Setting Up DNS and Traefik
To prevent CORS errors when using Lobe Chat through HTTPS behind a reverse proxy, follow these additional steps:
Ensure your Lobe Chat server's container can reach the Signaling Server (you may ping it to verify).
If using Cloudflare, set a new CNAME DNS record to point to the signaling server (e.g.,
signaling-lobe
with target @).Configure Traefik with the following dynamic configurations:
Note
I'm using
https
andhttp
entrypoins, in your setup it could bewebsecure
&insecure
or something else.Also you need to replace addresses with your domains as well as change ports if yours are custom.
https://signaling-lobe.{MY_DOMAIN}/ws
This configuration allows you to sync your Lobe Chat even when you're not on the local network.
Beta Was this translation helpful? Give feedback.
All reactions