A WebRTC-Based Generic Way to Create An Isolated P2P Network

This article is a sequel to “Creating an Isolated P2P Network with IPFS.” I am still researching ways to create an isolated P2P network. The following is one such way which uses WebRTC. My focus is on the creation of an isolated P2P network, but this is more a template for building a browser/Node.js-based P2P app.

Essentially, use mafintosh/signalhub: Simple signalling server that can be used to coordinate handshaking with webrtc or other fun stuff with mafintosh/webrtc-swarm: Create a swarm of p2p connections using webrtc and a signalhub, which is based on feross/simple-peer: 📡 Simple WebRTC video, voice, and data channels.

This is pretty much the recipe presented in “Building P2P Video Chat Application using webRTC and Node.js.” See also “I MADE A WEBRTC MISTAKE – YouTube.” The concern I have is webrtc-swarm was last updated 3 years ago, and may be a little outdated (see “simple-peer entry is a bit outdated · Issue #39 · mafintosh/webrtc-swarm” ).

It’d be best to host your own signalhub, but you might have to use a public one for whatever reasons. You can have added security with secure-webrtc-swarm (repository already archived). The shared secret key is expected to be shared “out of band,” so it may not be as sophisticated a method as that uses Diffie–Hellman key exchange.

Another potential issue is that the signalhub+webrtc-swarm method does not provide any utility to make communication among peers efficient (would that be called routing?) when there are more than two of them. Simple-Peer recommends creating a full-mesh network, but at the same admits its apparent inefficiency.

Beginner’s Tutorial to WebRTC using PeerJS | Toptal” is not about Simple-Peer, but rather PeerJS, which seems to have pretty similar functionality. It gives a concise introduction to WebRTC.

A WebRTC-Based Generic Way to Create An Isolated P2P Network」への1件のフィードバック

  1. ピンバック: Creating an Isolated P2P Network with Hypercore | あくまで暫定措置としてのブログ



WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト /  変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト /  変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト /  変更 )

%s と連携中

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください