Search code examples
network-programmingsshwebrtcp2plibp2p

Whats the difference between WebRTC and libp2p?


I'm trying to build a p2p terminal sharing utility where PCs behind a NAT can share their terminals to other PCs behind a NAT through the public internet. (both PCs are on different private network basically). Another requirement is to provide a web based terminal as well ( and hence webrtc seems useful ) .Came across two promising solutions - webrtc and libp2p. But what is the fundamental difference between the two?

PS: ssh Tag might be misleading here. But on a broad level, all I'm trying to do is a make-believe SSH into a system that does not have a public IP


Solution

    • WebRTC is a low-level Browser API for P2P communication between browsers. See MDN documentation or Wikipedia article for high-level introduction and history.
    • libp2p is a library written in JS, NodeJS, Go, Rust (with more in the way) that implements Peer to Peer communication based on IPFS. From what I see it uses WebRTC and WebSockets in Browser.