MenuMenu

RTCMultiConnection.iceServers

Set your own STUN and TURN servers

Use this javascript array to set your own STUN+TURN servers.

See how to install your own TURN server.

Usage

// first step, ignore default STUN+TURN servers
connection.iceServers = [];

// second step, set STUN url
connection.iceServers.push({
    urls: 'stun:yourSTUN.com:port'
});

// last step, set TURN url (recommended)
connection.iceServers.push({
    urls: 'turn:yourTURN.com:port',
    credential: 'password',
    username: 'username'
});

Description

parameterdescription
javascript array 1) "urls" set the URL for STUN or TURN server
2) "credential" set TURN password
3) "username" set TURN user-name

Demo

<script src="https://rtcmulticonnection.herokuapp.com/dist/RTCMultiConnection.min.js"></script>
<script src="https://rtcmulticonnection.herokuapp.com/socket.io/socket.io.js"></script>

<script>
var connection = new RTCMultiConnection();

// this line is VERY_important
connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';

// if you want audio+video conferencing
connection.session = {
    audio: true,
    video: true
};

// first step, ignore default STUN+TURN servers
connection.iceServers = [];

// second step, set STUN url
connection.iceServers.push({
    urls: 'stun:yourSTUN.com:port'
});

// last step, set TURN url (recommended)
connection.iceServers.push({
    urls: 'turn:yourTURN.com:port',
    credential: 'password',
    username: 'username'
});

connection.openOrJoin('your-room-id');
</script>