From 590c5ea900904bca623224eb911c7287aaf9181f Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Mon, 6 Oct 2014 16:53:09 +0200 Subject: [PATCH] switched to self hosted peerjs server --- examples/PeerJs-Json/index.js | 20 +++++++++++++++++++- examples/TextEditing/index.js | 27 ++++++++++++++++----------- examples/XmlExample/index.js | 21 ++++++++++++++++++++- examples/temp_ex/index.js | 21 ++++++++++++++++++++- 4 files changed, 75 insertions(+), 14 deletions(-) diff --git a/examples/PeerJs-Json/index.js b/examples/PeerJs-Json/index.js index 6c704720..27313d4f 100644 --- a/examples/PeerJs-Json/index.js +++ b/examples/PeerJs-Json/index.js @@ -24,7 +24,25 @@ The first parameter of `createPeerJsConnector` is forwarded as the options objec Therefore, you may also specify the server/port here, if you have set up your own server. */ var yatta, yattaHandler; -Y.createPeerJsConnector({key: 'h7nlefbgavh1tt9'}, function(Connector, user_id){ + +/** + This will connect to the server owned by the peerjs team. + For now, you can use my API key. +*/ +// var conn = {key: 'h7nlefbgavh1tt9'}; + +/** +This will connect to one of my peerjs instances. +I can't guaranty that this will be always up. This is why you should use the previous method with the api key, +or set up your own server. +*/ +var conn = { + host: "terrific-peerjs.herokuapp.com", + port: "", // this works because heroku can forward to the right port. + // debug: true, +}; + +Y.createPeerJsConnector(conn, function(Connector, user_id){ /** You can also specify your own user_id with peerjs. diff --git a/examples/TextEditing/index.js b/examples/TextEditing/index.js index 4181dbb1..b3f1c11d 100644 --- a/examples/TextEditing/index.js +++ b/examples/TextEditing/index.js @@ -25,18 +25,23 @@ function init(){ First create the connector - the underlaying communication protocol. Here, we use the PeerJs connector. Its first parameter is the API key that you need to specify (see [website](http://peerjs.com/)) */ - /* - // this will connect to the server owned by the peerjs team. - // For now, you can use my API key. - var conn = {key: 'h7nlefbgavh1tt9'}; - */ + + /** + This will connect to the server owned by the peerjs team. + For now, you can use my API key. + */ + // var conn = {key: 'h7nlefbgavh1tt9'}; + + /** + This will connect to one of my peerjs instances. + I can't guaranty that this will be always up. This is why you should use the previous method with the api key, + or set up your own server. + */ var conn = { - host: "terrific-peerjs.herokuapp.com/", - port: 4609, - path: "/", - debug: true, - secure: false - }; // I can't guaranty that this will be always up. This is why you should use the previous method with the api key. + host: "terrific-peerjs.herokuapp.com", + port: "", // this works because heroku can forward to the right port. + // debug: true, + }; Y.createPeerJsConnector(conn, function(Connector, user_id){ /** diff --git a/examples/XmlExample/index.js b/examples/XmlExample/index.js index 5a0cc700..4f24ba20 100644 --- a/examples/XmlExample/index.js +++ b/examples/XmlExample/index.js @@ -24,7 +24,26 @@ The first parameter of `createPeerJsConnector` is forwarded as the options objec Therefore, you may also specify the server/port here, if you have set up your own server. */ var yatta, yattaHandler; -Y.createPeerJsConnector({key: 'h7nlefbgavh1tt9'}, function(Connector, user_id){ + + +/** + This will connect to the server owned by the peerjs team. + For now, you can use my API key. +*/ +// var conn = {key: 'h7nlefbgavh1tt9'}; + +/** +This will connect to one of my peerjs instances. +I can't guaranty that this will be always up. This is why you should use the previous method with the api key, +or set up your own server. +*/ +var conn = { + host: "terrific-peerjs.herokuapp.com", + port: "", // this works because heroku can forward to the right port. + // debug: true, +}; + +Y.createPeerJsConnector(conn, function(Connector, user_id){ yatta = new Y.XmlFramework(user_id, Connector); diff --git a/examples/temp_ex/index.js b/examples/temp_ex/index.js index c8b53ba2..e4725c54 100644 --- a/examples/temp_ex/index.js +++ b/examples/temp_ex/index.js @@ -24,7 +24,26 @@ The first parameter of `createPeerJsConnector` is forwarded as the options objec Therefore, you may also specify the server/port here, if you have set up your own server. */ var yatta, yattaHandler; -Y.createPeerJsConnector({key: 'h7nlefbgavh1tt9'}, function(Connector, user_id){ + +/** + This will connect to the server owned by the peerjs team. + For now, you can use my API key. +*/ +// var conn = {key: 'h7nlefbgavh1tt9'}; + +/** +This will connect to one of my peerjs instances. +I can't guaranty that this will be always up. This is why you should use the previous method with the api key, +or set up your own server. +*/ +var conn = { + host: "terrific-peerjs.herokuapp.com", + port: "", // this works because heroku can forward to the right port. + // debug: true +}; + + +Y.createPeerJsConnector(conn, function(Connector, user_id){ /** You can also specify your own user_id with peerjs.