Here is the code (cut) Im using:
/* create peer */
peer = new Peer(_id, config.p2p); //tried turn server on/off
peer.on('open', function(__id){
/* connect to peers */
_this._connect(peer_id);
});
/* handle incoming connections */
peer.on('connection' ,function(conn){
debug.log('p2p: new peer connected');
});
/* handle error */
peer.on('error' ,function(err){
debug.log('p2p: error opening connection ' + err);
});
/* connect to peer */
this._connect = function(_peerId){
var conn = peer.connect(_peerId, {
'reliable': false //tried reliable: false/true here
});
conn.on('open', function(){
conn.on('data', function(data){
_this.forward(data);
});
});
}
Both peers (guest B & host A machines) are created without problems. Then I try to establish the connection from A:
_connect("18b23a1b420ab7e46dedf503502b94aa2e41c1db95e4bacaabd63f5cc5f5d696")
in the console on B I see incoming connection:
> p2p: new peer connected
And after this an error occurs:
> p2p: error opening connection CreateAnswer failed.
Connection is present in the peer.connections (A & B) but open=false and I cant send any data at all.
This is very annoying issue and I have no idea what to do with it. What's the most interesting - everything works perfect with peerjs v.0.2.8. Is it a bug, or?
And one small notice: clients with peers 0.2.8 & 3.0.x cant connect to each other
Please help me on this. Thank you
And when I try to connect from B to A - A crashes (chrome crash page) (but maybe thats not supported by code)
A is running 31.0.1650.26 beta-m
B is running 30.0.1599.101 m
Just switched to 0.2.8 branch and tried to connect from host to guest, everything works perfect
416abdf24c07e3b7da889fe17c2be96adc9a4c4fd02ded90a9e9bc5ef78b23ea: Object
peerjs: DataConnection
_dc: RTCDataChannel
...
open: true