Configure TURN and STUN servers

This commit is contained in:
Corey Johnson & Matt Colyer
2013-07-23 17:48:34 -07:00
parent 1bd9a6bef3
commit 07dea75562
4 changed files with 5 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ class GuestSession
window.site = new telepath.Site(@getId())
doc = window.site.deserializeDocument(data.doc)
servers = null
servers = {iceServers: [{url: "turn:54.218.196.152:3478", credential:"youhavetoberealistic"}]}
mediaConnection = new webkitRTCPeerConnection(servers)
mediaConnection.onicecandidate = (event) =>
return unless event.candidate?

View File

@@ -19,7 +19,7 @@ class HostSession
start: ->
return if @peer?
servers = null
servers = {iceServers: [{url: "turn:54.218.196.152:3478", credential:"youhavetoberealistic"}]}
mediaConnection = new webkitRTCPeerConnection(servers)
mediaConnection.onicecandidate = (event) =>
return unless event.candidate?

View File

@@ -23,7 +23,9 @@ module.exports =
createPeer: ->
id = Guid.create().toString()
new Peer(id, key: '0njqmaln320dlsor')
key = '0njqmaln320dlsor'
config = {iceServers: [{url: "turn:54.218.196.152:3478", credential:"youhavetoberealistic"}]}
new Peer(id, {key, config})
connectDocument: (doc, connection) ->
nextOutputEventId = 1

View File

@@ -1135,7 +1135,6 @@ function Peer(id, options) {
if (!(this instanceof Peer)) return new Peer(id, options);
EventEmitter.call(this);
options = util.extend({
debug: false,
host: '0.peerjs.com',