switch to self hosted peerjs server
This commit is contained in:
@@ -29,7 +29,14 @@ Here, we use the PeerJs connector. Its first parameter is the API key that you n
|
||||
|
||||
|
||||
```js
|
||||
Y.createPeerJsConnector({key: 'h7nlefbgavh1tt9'}, function(Connector, user_id){
|
||||
/*
|
||||
var conn = {key: 'h7nlefbgavh1tt9'}; // this will connect to the server owned by the peerjs team.
|
||||
*/
|
||||
var conn = {
|
||||
host: "127.0.0.1/", //"terrific-peerjs.herokuapp.com/",
|
||||
port: 5000
|
||||
};
|
||||
Y.createPeerJsConnector(conn , function(Connector, user_id){
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,20 @@ 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/))
|
||||
*/
|
||||
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'};
|
||||
*/
|
||||
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.
|
||||
|
||||
Y.createPeerJsConnector(conn, function(Connector, user_id){
|
||||
/**
|
||||
TextFramework is a shared text object. If you change something on this object,
|
||||
it will be instantaneously shared with all the other collaborators.
|
||||
|
||||
@@ -63,13 +63,6 @@ Connect to other peer.
|
||||
|
||||
yatta.val($("#collaborative")[0])
|
||||
console.log(yatta.getUserId());
|
||||
$("#collaborative").attr("contenteditable","true");
|
||||
$("#collaborative")[0].onkeyup = function(){
|
||||
console.log("dtrn");
|
||||
console.log("rtdn");
|
||||
}
|
||||
$("p")[0].onfocus = function(){
|
||||
console.log("nrtduiaenrtduiaer");
|
||||
}
|
||||
|
||||
});
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user