create a sfu video calling.
1
zfrika
what is the current digital ocean vps specs? is it 2vcpu/4gb ? currently I have 2vcpu-4gb droplet.
That is a common point of confusion. You aren’t "wrong"—a TURN server is technically required for **universal** connectivity—but you were likely succeeding because of how WebRTC handles connection candidates and the specific networks you were testing on. Here is why it worked without TURN: ### 1. The "Host" Candidate Success In your current setup, your Mediasoup server is likely running on a cloud VPS (like DigitalOcean, AWS, or Hetzner) with a **publicly reachable IP address**. When you connect: * The **Server** sends its "Host" candidate (its public IP). * The **Client** (you) sends its candidates. * Because the server is sitting directly on the public internet, your computer can "see" it and send packets to it directly, even if you are behind a home router (NAT). As long as one side (the server) is fully public and the other side (the client) isn't behind a "Symmetric NAT" (common in strict corporate offices), a direct connection will succeed. ### 2. You are using "STUN" by default Even if you didn't install a TURN server, Mediasoup and the browser use STUN (often via Google's public servers like `stun:stun.l.google.com:19302`). * STUN allows your home router to open a port and map it to your laptop. * Once that hole is punched, the Mediasoup server can talk to you directly. ### 3. Most Home NATs are "Friendly" Most home routers use **Endpoint-Independent Mapping**. This means once you send a packet out to your Mediasoup server, the router keeps that "door" open for the server to reply. This "hole punching" works about 80% of the time for general consumers. --- ### So, when will it FAIL? (Why you still need TURN) You will run into a wall the moment one of these scenarios happens: * **Symmetric NAT:** If a user is at a large university, a hospital, or a corporate office, their router will change the port for every destination. STUN cannot predict this, and hole punching will fail 100% of the time. * **Strict Firewalls:** Some firewalls block all UDP traffic except for specific ports. TURN (especially over TCP/443) acts as a "tunnel" to bypass these restrictions. * **Mobile Networks:** Some 4G/5G carriers use carrier-grade NAT (CGNAT) which can be very aggressive and block direct peer-to-server connections. ### 📊 The 80/20 Rule * **Without TURN:** Your app will work for ~80% of users (Home users, simple setups). * **With TURN:** Your app will work for ~99.9% of users (Corporate, Mobile, Restricted environments). --- ### 💡 Recommendation If this is a hobby project for friends, you don't need TURN. If you intend to have users joining from offices or mobile data, you should at least plug in a **Twilio TURN** or **Cloudflare Calls** credential as a fallback. **Would you like me to show you a simple test you can run in your browser console to see if your current network is one of the "strict" ones that would require a TURN server?**
completeNodeClient_v2.js will be updated. Port configuration: need a large range of UDP ports for media track (10000-20000) update the the socket.io logic to talk to SFU API. implement simulcast. offer low, medium , high quality .
find a sfu engine. (done. media soup) BandWidth: VPS with high output bandwidth. 2vCPU/4GB plan. for 20 concurrent users. (done) select which SFU to install. LiveKit media soup (cheapest cost) create a new droplet to serve sfu media soup purchase domain : zfrikavideocall.online. this domain expires in a year. purchase for $2. frontend and backend are officially speaking the same language, the library is bundled correctly, and the initial handshake (RTP Capabilities) is working. test 4 users with video all appearing consistently. (done) disconnecting remove them from the call. mute button and turn off video button. private room so that two groups can have seperate calls.
setup twilio or coturn for TURN Server