Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.41 KB

File metadata and controls

40 lines (27 loc) · 1.41 KB

SecurePeerServer

SecurePeerServer is an extension to PeerServer that adds hybrid encryption and signature verification to connecting peers. This allows peers to guarantee their identity and establish a secure connection between other peers.

This library is part of SecurePeerJS

Installation

npm i securepeerserver

Usage

To start the server, a SecurePeerKey is needed (included in the server dependencies).

import { SecurePeerKey, createSecurePeerServer } from 'securepeerserver'

SecurePeerKey.create('theserverkey').then((key: SecurePeerKey) => {
  createSecurePeerServer(key, {
    port: 9000,
    path: '/'
  })
}).catch(console.error)
  • The createSecurePeerServer accepts the same options as a normal peerserver, with the exception of generateClientId
  • Also available createSecureExpressPeerServer for the equivalent ExpressPeerServer

See exampleserver for a running node

> [email protected] start
> node out/server.js

SecurePeerServer config { port: 9000, path: '/', generateClientId: undefined }
SecurePeerServer Public Key: 7d169e89fbf1c82addbbe3d3f01c94239ee636fdd691fba5a915893d0bb93b3f