Question about Godot WebRTC signaling demo

Godot Version 4.2.2


I’ve been trying for a while to set up a p2p connection using webRTC.

I finally manage to set up everything.
A STUN/TURN server (coturn)
and a signaling server (node)

All based on this demo godot-demo-projects/networking/webrtc_signaling at master · godotengine/godot-demo-projects · GitHub

Everything works fine but. The peer.initialize() (godot-demo-projects/networking/webrtc_signaling/client/ at master · godotengine/godot-demo-projects · GitHub → line 35) function seem to make no difference if I add a turn server or not.

The project will work with or without it.

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.