I am given to understand that if I want to use wss I need to have certification and key so I generated two
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 100 -nodes
I have a code which works in Express but does not work as following :
const server = https.createServer({
cert: fs.readFileSync('/www/wwwroot/mydomain/cert/cert.pem'),
key: fs.readFileSync('/www/wwwroot/mydomain/cert/key.pem')
});
console.log(server)
const wss = new Websocket.Server({ server })
server.listen(8082)
How can I run wss in nextjs?