I'm using socket.io with easyrtc to have a p2p video chat. Working example at https://github.com/merictaze/enlargify with following package versions
"express": "^4.15.2",
"easyrtc": "1.0.x", // easyrtc@1.0.15
"socket.io": "^1.4.5"
The easyrtc logic used is at https://github.com/merictaze/enlargify/blob/master/public/resources/js/app.js
However, if i bump up easyrtc version to 1.1 The code stops working. I've even tried the beta branch.
"express": "^4.15.2",
"easyrtc": "priologic/easyrtc#beta",
"socket.io": "^1.4.5"
I know this isn't helping much, so on further investigation i found out that it fails at this call
easyrtc.call(self.partnerId, successCB, failureCB, acceptedCB);
The Error code from failureCB is
MSG_REJECT_TARGET_EASYRTCID
On the server side the log shows
2017-12-07T07:02:40.477Z - debug - EasyRTC: [enlargify_app][fNhseVCWzi8XXhn5] EasyRTC command received with msgType [offer] undefined
2017-12-07T07:02:40.478Z - warning - EasyRTC: Attempt to request non-existent connection key: '0xv7UpIAlVeAzEedAAAA' undefined
2017-12-07T07:02:40.479Z - warning - EasyRTC: [enlargify_app][fNhseVCWzi8XXhn5] Could not send WebRTC signal to client [0xv7UpIAlVeAzEedAAAA]. They may no longer be online. undefined
However, reverting the easyrtc version back in package.json works as it does on the demo here http://enlargify.herokuapp.com/
I want to update the easyrtc version because of the safari support in the beta branch. I found the demos working smoothly.
ps. I did update the socket.io version and updated the deprecated calls e.g
partnerSocket = io.sockets.socket(socket.partnerId);
partnerSocket.emit("disconnect_partner", socket.id);
to
io.to(socket.partnerId).emit("disconnect_partner", socket.id);
Further investigations show that the socket.id generated on the client side is different from the one on server. That's why the two peers are unable to connect.
Any idea how i can get success function of easyrtc.connect to return the correct socketID?