2 ms·
> No, it's not using TURN server now. You state it uses PeerJS. And indeed, the code calls from PeerJS, const peer = new Peer(); (https://github.com/tongho
by deathanatos 2y ago
> No, it's not using TURN server now.
You state it uses PeerJS. And indeed, the code calls from PeerJS,
const peer = new Peer();
(https://github.com/tonghohin/screen-sharing/blob/18f6ab93716cf5bdec57625b91c6620cc84c173b/app/join/page.tsx#L33 https://github.com/tonghohin/screen-sharing/blob/18f6ab93716...)
I.e., it constructs a PeerJS Peer without manually specifying PeerOptions. That class, in turn, states,
/**
* Configuration hash passed to RTCPeerConnection.
* This hash contains any custom ICE/TURN server configuration.
*
* Defaults to {@apilink util.defaultConfig}
*/
config?: any;
Since we're not overriding it, we take the default. And `defaultConfig` leads us to: https://github.com/peers/peerjs/blob/c073252f879b57757f8a82d40302bbe06a3890e0/lib/util.ts#L38-L51 https://github.com/peers/peerjs/blob/c073252f879b57757f8a82d... which lists STUN & TURN servers.
… so it sure looks to me like it is using a TURN server…
- tonghohin 2y agoSorry for the misleading wording, I was trying to say that I'm not paying for any TURN servers. You are totally right, PeerJS is still using TURN server under the hood. Thanks for pointing that out!