All Projects → samuelmaddock → swarm-peer-server

samuelmaddock / swarm-peer-server

Licence: MIT license
🖧 A network swarm for creating secure P2P connections over BitTorrent DHT, DNS, and mDNS.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to swarm-peer-server

Tribler
Privacy enhanced BitTorrent client with P2P content discovery
Stars: ✭ 3,915 (+9448.78%)
Mutual labels:  bittorrent, decentralized, p2p
Zeronet
ZeroNet - Decentralized websites using Bitcoin crypto and BitTorrent network
Stars: ✭ 17,227 (+41917.07%)
Mutual labels:  bittorrent, decentralized, p2p
Newnode
NewNode decentralized Content Distribution Network
Stars: ✭ 223 (+443.9%)
Mutual labels:  bittorrent, decentralized, p2p
Lbry Sdk
The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
Stars: ✭ 7,169 (+17385.37%)
Mutual labels:  bittorrent, decentralized, p2p
Autodl Trackers
Tracker files for autodl-community fork of autodl-irssi
Stars: ✭ 133 (+224.39%)
Mutual labels:  bittorrent, p2p
Torrentinim
A very low memory-footprint, self hosted API-only torrent search engine. Sonarr + Radarr Compatible, native support for Linux, Mac and Windows.
Stars: ✭ 123 (+200%)
Mutual labels:  bittorrent, p2p
Bitlet
A small Java bittorrent library, powering BitLet.org
Stars: ✭ 142 (+246.34%)
Mutual labels:  bittorrent, p2p
Bt
BitTorrent library and client with DHT, magnet links, encryption and more
Stars: ✭ 2,011 (+4804.88%)
Mutual labels:  bittorrent, p2p
Rats Search
BitTorrent P2P multi-platform search engine for Desktop and Web servers with integrated torrent client.
Stars: ✭ 1,037 (+2429.27%)
Mutual labels:  bittorrent, p2p
Wt Tracker
High-performance WebTorrent tracker
Stars: ✭ 144 (+251.22%)
Mutual labels:  bittorrent, p2p
Luminance
Stars: ✭ 173 (+321.95%)
Mutual labels:  bittorrent, p2p
Snail
基于Java、JavaFX开发的下载工具,支持下载协议:BT(BitTorrent、磁力链接、种子文件)、HLS(M3U8)、FTP、HTTP。人家才不要你的⭐⭐呢,哼
Stars: ✭ 102 (+148.78%)
Mutual labels:  bittorrent, p2p
Phpspidermagnetbittorrent
php实现p2p中DHT网络爬虫,并提供搜索下载
Stars: ✭ 64 (+56.1%)
Mutual labels:  bittorrent, p2p
Pytorrent
Simple and functional BitTorrent client made in Python - Use for learning
Stars: ✭ 135 (+229.27%)
Mutual labels:  bittorrent, p2p
Webtorrent Desktop
❤️ Streaming torrent app for Mac, Windows, and Linux
Stars: ✭ 8,587 (+20843.9%)
Mutual labels:  bittorrent, p2p
Torrentpier
Main project repository
Stars: ✭ 166 (+304.88%)
Mutual labels:  bittorrent, p2p
Torrent Discovery
Discover BitTorrent and WebTorrent peers
Stars: ✭ 177 (+331.71%)
Mutual labels:  bittorrent, p2p
Transgui
🧲 A feature rich cross platform Transmission BitTorrent client. Faster and has more functionality than the built-in web GUI.
Stars: ✭ 2,488 (+5968.29%)
Mutual labels:  bittorrent, p2p
Cratetorrent
A BitTorrent V1 engine library for Rust (and currently Linux)
Stars: ✭ 233 (+468.29%)
Mutual labels:  bittorrent, p2p
P2p Media Loader
An open-source engine for P2P streaming of live and on demand video directly in a web browser HTML page
Stars: ✭ 822 (+1904.88%)
Mutual labels:  bittorrent, p2p

swarm-peer-server

A network swarm for creating secure P2P connections over Bittorrent DHT, DNS, and mDNS.

Uses discovery-swarm to find and connect peers. Connections use asymmetric encryption and Elliptic-curve Diffie-Hellman to establish a secure communication channel. Clients must know the public key of a peer ahead of time to initiate the connection.

Depends on native modules libsodium (via sodium-native) and libutp (via utp-native).

npm install swarm-peer-server

Usage

Server

var swarm = require('swarm-peer-server')

swarm.listen({
  publicKey: Buffer.from('...'),
  secretKey: Buffer.from('...')
}, (socket, peerKey, info) => {
  console.log('New authenticated connection')
  socket.once('data', data => {
    console.log('Received:', data.toString())
    socket.destroy()
  })
})

Client

var swarm = require('swarm-peer-server')

var { socket } = await swarm.connect({
  publicKey: Buffer.from('...'),
  secretKey: Buffer.from('...'),
  hostPublicKey: Buffer.from('...')
})

console.log('Established connection')
const data = Buffer.from('hello world')
socket.write(data)

Examples

examples/echo.js # CLI echo server

API

var sw = swarm.listen(opts)

Create a new swarm server. Options include:

{
  publicKey: crypto.randomBytes(32), // server public key
  secretKey: crypto.randomBytes(64), // server secret key
  convert: false, // convert signatures to authentication encryption [1]
}

[1] https://download.libsodium.org/doc/advanced/ed25519-curve25519.html

For full list of options take a look at discovery-swarm or the TypeScript definitions.

swarm.connect(opts, (socket, peerKey, info) => {})

Create a new swarm server. Options include:

{
  hostPublicKey: crypto.randomBytes(32), // host/server public key
  publicKey: crypto.randomBytes(32), // client public key
  secretKey: crypto.randomBytes(64), // client secret key
  convert: false, // convert signatures to authentication encryption
}

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].