Conceptually I am unable to comprehend that how 2 devices, which are connected to their respective Wifi networks (for example) are able to establish a peer to peer connection, even with intermediate temporary server in between.
E.g. Computer A's public IP is 1.1.1.1 & private IP is 192.x.x.x. Computer B's public IP is 2.2.2.2 & private IP is 192.y.y.y. Without any firewall etc. (general case), how will they make a direct socket connection among them?
Will appreciate if you can explain in slightly layman's term.
Context: I am studying a server, which intends to provide WebRTC in the browser. Using Google's STUN server, they are able to exchange media in many cases. But conceptually I am unclear, on what takes place in between.