Note: I've already read this question, its main answer and all the linked questions given there (more than 8 questions, such as this one but it talks about Flash, etc.). They are all ~ 2011, and things might have changed, thanks to new tech like WebRTC, etc.
Question:
If I give my IP to a friend, and he gives me his IP, can we send bytes to each other directly in the browser, with Javascript? (both users not in the same local network but connected via internet)
If possible, without any 3rd party server. In this case we would both load a local HTML file containg the Javascript code allowing connection to each other. It seems possible to do such things with "chownat":
allows clients behind NATs to communicate with a server behind a separate NAT with no port forwarding no DMZ setup, and no 3rd party involvement.
If not possible without any server, then is it possible with a server involved just at the beginning of the process? (to make peers meet / know each other / to initiate the connection). Then once connection is established, the server would not be needed anymore: the 2 peers send bytes to each other, without server.
Is 1. or 2. possible nowadays with a standard browser (Firefox, Chrome, etc.) and without any router port configuration? With WebRTC for example?
Note: I've read about RTCDataChannel
and tried this Simple_RTCDataChannel_sample but I don't see how two distant people can use this to connect to each other, this sample doesn't cover that. Here is the live demo. I don't see how it can be turned into a connection between two peers on internet.