Open Yongqi-Liang opened 7 months ago
All right,The problem has fixed done:
const fs = require('fs'); //add
const options = { //add
key: fs.readFileSync('path/to/key.pem'), //add
cert: fs.readFileSync('path/to/cert.pem') //add
}; /add
const http = require('https').createServer(options,app) //change`http -> https` and add `options`
events.js:291 throw er; // Unhandled 'error' event ^
Error: listen EACCES: permission denied 0.0.0.0:443 at Server.setupListenHandle [as _listen2] (net.js:1293:21) at listenInCluster (net.js:1358:12) at Server.listen (net.js:1444:7) at Object. (/home/gsxy02/Github-workspaces/Shared/zoom-web2.0/server.js:40:6)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
Emitted 'error' event at:
at WebSocketServer. (/home/gsxy02/Github-workspaces/Shared/zoom-web2.0/node_modules/peer/dist/src/instance.js:53:13)
at WebSocketServer.emit (events.js:314:20)
at WebSocketServer._onSocketError (/home/gsxy02/Github-workspaces/Shared/zoom-web2.0/node_modules/peer/dist/src/services/webSocketServer/index.js:49:14)
at WebSocketServer. (/home/gsxy02/Github-workspaces/Shared/zoom-web2.0/node_modules/peer/dist/src/services/webSocketServer/index.js:22:55)
at WebSocketServer.emit (events.js:314:20)
at Server.emit (events.js:314:20)
at emitErrorNT (net.js:1337:8)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'EACCES',
errno: 'EACCES',
syscall: 'listen',
address: '0.0.0.0',
port: 443
}
gsxy02@gsxy02-Standard-PC-i440FX-PIIX-1996:~/Github-workspaces/Shared/zoom-web2.0$