Is it possible for WebRTC to use active request to help one peer blocked by the NAT firewall to establish a connection ?

25 views
Skip to first unread message

吴何聪

unread,
Sep 14, 2021, 3:59:49 AM (12 days ago) Sep 14
to discuss-webrtc
Now I have two browsers running PeerJS on two different remote servers. Both the two servers could get candidates from stub server. But it seems that one of the servers was blocked by its administrator for p2p usage through the firewall. Therefore, a connection is established at both sides but the data channel cannot be opened to transmit data. 

I used serverless WebRTC for debugging, manually imported the sdp on both ends, and found that the ice candidate state failed. 

The other server should have no problems, because it can establish p2p connections with other servers and transmit data.

My servers can request datas from the outside world normally. I don't quite understand how the firewall works. It may block the messages sent from the outside without a request the server sent first.

I was thinking, since the blocked side can obtain the sdp information of the other side through the signaling server, can the other side be used as the server and itself as the client? 

This side uses information such as the ip address and port contained in the sdp to send something like a heartbeat packet to the other side. When the other side responds,  include the messages the other side wants to send in the response body.

I don't know if this will solve the problem. And this seems to undermine the idea of p2p . After all, one side becomes like a server.

Of course, my main purpose is to ask whether there is some implementation in WebRTC that can establish a data channel between the one side blocked by the firewall and the other side not.

If not, is there an alternative to use the information returned by the stub server to establish communication? In other words, is there any code to solve this problem?

I am very new in communication. So come to seek your help. Looking forward to your response. 

Forgive me for using a translator because my English is not so good.

Ben Weekes

unread,
Sep 14, 2021, 4:32:12 AM (11 days ago) Sep 14
to discuss-webrtc
Hi,

The TURN protocol can be used to relay the voice/video & data traffic of a user behind a strict firewall. At agora.io, all this works out of the box with our SDKs for building apps and services such as yours. Please get in touch,
Reply all
Reply to author
Forward
0 new messages