Soumojitshome2023 / nextjs-videocall-webapp

https://soumojit-nextjs-videocall-webapp.vercel.app/
11 stars 33 forks source link

WebRTC Video Call Only Works on Same Wi-Fi Network #20

Open Soumojitshome2023 opened 1 month ago

Soumojitshome2023 commented 1 month ago

In the current implementation of the WebRTC video call feature using Socket.IO, the video call connection works perfectly when both users are connected to the same Wi-Fi network. However, when users are on different networks (e.g., one on a mobile network and the other on home Wi-Fi), the video call fails to establish. This suggests that the issue might be related to NAT traversal or improper configuration of STUN/TURN servers.

Steps to Reproduce: Connect both users to the same Wi-Fi network. Initiate a video call — the call connects successfully. Disconnect one user and switch them to a different network (e.g., mobile data or another Wi-Fi network). Attempt to start a video call — the call fails to connect.

Expected Behavior: The video call should establish successfully regardless of whether the users are on the same network or different networks.

Actual Behavior: The video call only works when both users are on the same network, and it fails when they are on different networks.

Possible Cause: This issue is likely related to NAT traversal, and proper configuration of STUN/TURN servers is necessary to allow WebRTC to work across different networks.

Suggested Fix: Investigate the STUN and TURN server configuration. Implement a reliable TURN server to facilitate connections between users on different networks.

Additional Information: WebRTC and Socket.IO are being used for the video call feature. Please ensure that the solution scales for different types of networks and devices.

PrayanshParmar commented 1 month ago

@Soumojitshome2023 Please assign this task to me.

Soumojitshome2023 commented 1 month ago

Okay Best of luck