I started my own PeerJS server, everything works, but now I don't know how to connect an ssl certificate to it. The documentation says:
Simply pass in PEM-encoded certificate and key.
const fs = require('fs');
const { PeerServer } = require('peer');
const peerServer = PeerServer({
port: 9000,
ssl: {
key: fs.readFileSync('/path/to/your/ssl/key/here.key'),
cert: fs.readFileSync('/path/to/your/ssl/certificate/here.crt')
}
});
and where to insert this code, where this file is located? please explain who knows...
This code should be added to the server.js file