I got the following code from the git-hub but I don\'t know how to use and execute.
$> npm install peer --->where i want to install this node_module
you can run :
npm install peer
Then your server.js you add: `
//Peer server
var privateKey = fs.readFileSync('sslcert/server.key', 'utf8');
var certificate = fs.readFileSync('sslcert/server.crt', 'utf8');
const { PeerServer } = require('peer');
const peerServer = PeerServer({ port: 443,
path: '/' ,
ssl: {
key: privateKey,
cert: certificate
}
});
` Make sure that on client side (script run on index.html) you have:
myPeer = new Peer({host:'/',
secure:true,
port:443,
path: '/'})