The WebRTC 1.0 signaling server lets MWebRTC objects and web pages find each other and set up their connections. It is a Node.js server that also serves ready-to-use streamer, viewer and two-way web pages.
It is published on GitHub: Medialooks-LLC/WebRTC1.0_Signaling_Server. Use this server instead of the older copy that some SDK installations carry in Samples WebRTC\SIGNALING SERVER.
It serves WebRTC 1.0 components only. WebRTC 2.0 components cannot use it; they need the WebRTC 2.0 signaling server.
HTTPS is required
MWebRTC objects connect over HTTPS only, and browsers allow camera, microphone and screen capture only on HTTPS pages (or on localhost). For use over a network you need a domain name and a TLS certificate for it.
Run with Docker (recommended)
You need a Linux server (x86-64) with Docker Engine 24 or newer and the Compose plugin.
- Download
webrtc1-signaling-server-x.y.z-deploy.zipandwebrtc1-signaling-server-x.y.z-docker-amd64.tar.gzfrom the latest release (x.y.zis the release version). - Unpack the deploy bundle into a folder on the server and load the image:
docker load -i webrtc1-signaling-server-x.y.z-docker-amd64.tar.gz - Put your certificate into the
certsfolder next todocker-compose.yml:fullchain.pem(certificate followed by the intermediate certificates) andprivkey.pem(private key). The user with id 1000 must be able to read both files. - Copy
.env.exampleto.envand set the domain name:DOMAIN=signal.example.com - Start the server and check it:
The answer isdocker compose up -d curl https://signal.example.com/healthz{"status":"ok"}.
The server listens on port 443 of the host; HTTPS_PORT in .env changes it. A renewed certificate is loaded without a restart. Let's Encrypt, self-signed certificates, a reverse proxy, updates and troubleshooting are described in DEPLOY.md.
Main settings of the .env file
| Setting | Default | Meaning |
|---|---|---|
DOMAIN |
required | Public name of the server, without https://, port or path |
HTTPS_PORT |
443 |
Port on the host |
CERTS_DIR, SSL_CERT_FILE, SSL_KEY_FILE
|
./certs, fullchain.pem, privkey.pem
|
Location of the certificate files |
MIN_TLS_VERSION |
TLS 1.0 | Set TLSv1.2 if all your clients support it (recommended) |
STUN_URLS |
Google STUN | STUN servers announced to the clients, or none
|
TURN_URLS, TURN_SECRET or TURN_USERNAME and TURN_PASSWORD
|
none | Your TURN server |
JANUS_URLS |
none | Your Janus servers |
MAX_CLIENTS_PER_ROOM |
no limit | Maximum number of clients in one room |
Run without Docker
You need Node.js 16 or newer. No packages have to be installed. In the folder with the server sources, run:
node server.js
This serves http://localhost:8888, enough to try the web pages on the same computer. For HTTPS, put the certificate into config/sslcerts/cert.pem and its key into config/sslcerts/key.pem, then start the production configuration, which listens on port 8889. In PowerShell:
$env:NODE_ENV = "production"; node server.js
Settings are in config/production.json and config/development.json.
Connect the SDK
The default value of the signaling_server property is https://rtc.medialooks.com:8889, a public server for tests only. Use your own address, either in the Login call or in the property before it:
string myId;
// The full address: server, room and the name of this peer.
webRTC.Login("https://signal.example.com/room/Studio", "", out myId);
webRTC.PropsSet("signaling_server", "https://signal.example.com");
webRTC.PropsSet("room", "room");
string myId;
webRTC.Login("", "Studio", out myId);
A desktop application can also take the address from the registry, as the default of the current user: value signaling_server of the key HKEY_CURRENT_USER\SOFTWARE\Medialooks\WebRTC.
The object must use the WebRTC 1.0 implementation, webrtc20.enabled=false. That is the default, but a saved setting can turn the 2.0 implementation on, and then Login to this server times out. In that case set the property before Login:
webRTC.PropsSet("webrtc20.enabled", "false");
Web pages
| Address | Page |
|---|---|
/ |
Start page |
/streamer |
Publish a camera, a screen or a test pattern |
/room-name/peer-name |
Watch that peer; a two-way page if the peer is in duplex or any mode |
The pages fit phones, tablets and computers. URL parameters (source, encoders, bit rates, automatic start) are listed in the server README. Your own web pages can load /ml-assets/ml-socket.js and /ml-assets/ml-webrtc.js from the server, as the supplied pages do.
Security
The signaling protocol has no authentication: anyone who can reach the server can join a room whose name they know and ask its peers for their streams. Use room names that cannot be guessed, and restrict access with a firewall or VPN if the streams are private.
Still have questions?
Tell us what didn’t work or what you’d like clarified.