I vaguely remember that I’ve heard somewhere that Godot may use its own STUN/TURN server when one is not initialized. Tho I am not sure how to confirm that.
If Godot its not using its own server then is the TURN part necessary at all? When is it necessary?
A TURN server ensures 2 peers can connect to each other when other options (STUN) have failed. It does this by relaying the network traffic through a TURN server.
Note that at that point its not really “p2p” anymore, as connections are not directly between 2 peers, but routed through e.g. coturn.
Whether 2 peers can connect to each other depends on both their local network. For example, a router may not do NAT properly, which means external help (TURN) is needed to connect anyway.
Here is what I tested so far:
If the connection is made only with the signaling server (node.js) everything works but the messages are being relayed by the signaling server (sealing the connection will NOT be possible if there is no STUN server in the peer.initialize)
It seems to me that the signaling server also acts as a TURN server.
I also configured a TURN server in coturn on a separate port, and added it in peer.initialize().
I do not know what difference does this make or even if this TURN server is used.
There are 3 elements:
Coturn STUN
Coturn TURN
When and how is this used?
How should I test this?
Node Signaling Server/Godot Signaling Server
seem to act as a TURN server as well.
Note:
In the signaling demo they use only a STUN server in peer.initialize()