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.