noise-network
Authenticated network P2P backed by HyperSwarm and NOISE
Usage
First spin up a server
const noise = const server = noise server const keyPair = noise // Announce ourself to the HyperSwarm DHT on the following keyPair's publicKeyserver
Then connect to the server by connecting to the public key
// noise guarantees that we connect to the server in a E2E encrypted streamconst client = noise // client is a noise-peer stream instanceclient
API
const server = noise.createServer([options])
Create a new NOISE server.
Options include:
// validate the remote client's public key before allowing them to connect { ... } // you can add the onconnection handler here also { ... }
const client = noise.connect(serverPublicKey, [keyPair])
Connect to a server. Does UDP hole punching if necessary.
serverPublicKey
must be of type Buffer or hex.
License
MIT