I have an application which is using PeerJS for video streaming, and I'm using a node based Peer Server running on an Ubuntu Server instance, over HTTPS (SSL certificates installed on the server).
This is how I instanciate my PeerServer :
var server = PeerServer({
port:55127,
path:'/',
debug:true,
ssl:{
key: fs.readFileSync('/etc/apache2/ssl/mykey.key'),
cert: fs.readFileSync('/etc/apache2/ssl/mycert.crt')
}
});
This is how I create a peer connection :
var peer = new Peer('peerHost',{host: 'myhost.com', port: 55127, path: '/'})
Regarding ports, I have allowed 55127 both in UFW and in the router.
For some strange reason, my peer connections and video streaming are working perfectly in the LAN, but failing over the internet - although sometimes they work, for instance in occasions over a 3G mobile network.
While debugging the Peer connection, I stumbled upon these "errors":
PeerJS: VP9 Codec: null
PeerJS: iceConnectionState is disconnected, closing connections to (...)
No errors on the server side, all these are either on the host or on the client.
This issue is similar to this, this and this.
Does anyone have any idea of what could be wrong and how it could be fixed ?
Thanks in advance.