WebSync Signaling Server

Muaz Khan edited this page Sep 11, 2015 · 1 revision

Use WebSync Signaling Server in any RTCMultiConnection demo

This wiki page explains how to use websync as signaling medium within any RTCMultiConnection demo.

You don't need to install WebSync server yourself. You simply need to copy/paste following HTML in your own PHP/ASPX/Python/etc. webpage and it will work!

Remember, it requires RTCMultiConnection v2.2.2 or earlier builds. It doesn't works with most recent version i.e. v3.0

<script src="http://websync.somee.com/fm.js"> </script>
<script src="http://websync.somee.com/fm.websync.js"> </script>
<script src="http://websync.somee.com/fm.websync.subscribers.js"> </script>
<script src="http://websync.somee.com/fm.websync.chat.js"> </script>

<script src="//cdn.webrtc-experiment.com/RTCMultiConnection.js"></script>
<button id="openNewSessionButton">Open New Room</button>
var connection = new RTCMultiConnection();

// easiest way to customize what you need!
connection.session = {
    audio: true,
    video: true

// on getting local or remote media stream
connection.onstream = function(e) {

// open new session
document.querySelector('#openNewSessionButton').onclick = function() {

<!-- WebSync signaling stuff happens below -->

var channels = {};
var username = connection.userid;

var domain = 'http://websync.somee.com/';

var client = new fm.websync.client(domain + 'websync.ashx');

    synchronous: true

    onSuccess: function() {
            channel: domain + 'chat',
            userId: username,
            userNickname: username,
            onReceive: function(event) {
                var message = JSON.parse(event.getData().text);
                if (channels[message.channel] && channels[message.channel].onmessage) {

connection.openSignalingChannel = function(config) {
    var channel = config.channel || this.channel;
    channels[channel] = config;

    if (config.onopen) setTimeout(config.onopen, 1000);
    return {
        send: function(message) {
                channel: domain + 'chat',
                data: {
                    username: username,
                    text: JSON.stringify({
                        message: message,
                        channel: channel

<!-- Don't forget calling "connect" or "join" after overriding above "openSignalingChannel" method -->

// setup signaling channel

Private WebSync Server?

If you are still interested to deploy and install your own WebSync server then you can take source code from this github repository:


WebSync demo is deployed on somee.com which doesn't supports HTTPs.

You should deploy it on Azure clouds or on any other ASP.NET hosting.