Created
June 21, 2019 07:58
-
-
Save rezoner/fd7aab89177a01ac460f8cdf8283ac34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let options = { | |
key: fs.readFileSync('./ssl/key.pem', "utf-8"), | |
cert: fs.readFileSync('./ssl/cert.pem', "utf-8") | |
}; | |
let httpsServer = https.createServer(options, (req, res) => { | |
req.socket.end(); | |
}); | |
this.server = new WebSocketServer({ | |
server: httpsServer, | |
perMessageDeflate: false, | |
noDelay: true | |
}); | |
this.server.on('connection', this.onconnect.bind(this)); | |
httpsServer.listen(ENV.wssPort); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment