Files
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00
..
2026-11-17 16:15:01 -05:00
2026-11-17 16:15:01 -05:00
2026-11-17 16:15:01 -05:00
2026-11-17 16:15:01 -05:00

WebRTC One-to-One video sharing using WebSockets / Demo

This WebRTC Experiment is using WebSockets for signalig.

=

How to use your own WebSocket implementation?

There is a built-in WebSocket over Node.js implementation that you can use in each and every WebRTC Experiment.

var SIGNALING_SERVER = 'ws://' + document.domain + ':8888/';
openSignalingChannel: function(config) {
    config.channel = config.channel || 'default-channel';
    var websocket = new WebSocket(SIGNALING_SERVER);
    websocket.channel = config.channel;
    websocket.onopen = function() {
        websocket.push(JSON.stringify({
            open: true,
            channel: config.channel
        }));
        if (config.callback)
            config.callback(websocket);
    };
    websocket.onmessage = function(event) {
        config.onmessage(JSON.parse(event.data));
    };
    websocket.push = websocket.send;
    websocket.send = function(data) {
        websocket.push(JSON.stringify({
            data: data,
            channel: config.channel
        }));
    };
}

In ui.js files you can find openSocket method; or in all libraries; you can find openSignalingChannel method.

=

Browser Support

This One-to-one WebRTC video chat using WebSocket experiment works fine on following web-browsers:

Browser Support
Firefox Stable / Aurora / Nightly
Google Chrome Stable / Canary / Beta / Dev
Android Chrome Beta

=

License

WebRTC One-to-One video sharing using WebSockets is released under MIT licence . Copyright (c) 2013 Muaz Khan.