gun icon indicating copy to clipboard operation
gun copied to clipboard

how does the peer-2-peer networking works?

Open Michel-HEG opened this issue 3 years ago • 2 comments

hello i'm a student from switzerland and i'm doing my final school thesis before graduation using gun.js. how does the p2p works with websocket and all, how the networking is done? thank you very much for your answer.

p.s: i love gun!

Michel-HEG avatar Aug 18 '22 15:08 Michel-HEG

Hey there! Gun uses something known as "WebRTC", which ensures P2P data transfer using the UDP protocol. Hence, to understand the networking process, I would recommend learning more about WebRTC.

TerranFenrir avatar Aug 23 '22 06:08 TerranFenrir

Gun relay servers use Multicast locally, followed by websockets to connect to other relay servers and browsers, then optionally WebRTC with and between browsers.

draeder avatar Aug 30 '22 17:08 draeder

👏 @Zevenstreity 👏 @draeder

@Michel-HEG there are 3 different layers, DAM, GUN, AXE - each evolve the networking algorithms a little bit, but are compatible with each other. Docs have a variety of explanations (mostly copied from answering Qs via chat), but I can probably give faster & more up-to-date explanation on a call, will you DM me on twitter and we'll schedule a podcast to discuss it? Some of the podcasts recorded in the last 6 months also explain pieces too, but I'd have to dig up their links...

Gonna close (as not a bug). DM me! Then when we're done, paste those old links, or the new one we record, here, so others can find it.

amark avatar Sep 27 '22 23:09 amark