Skip to content

Commit

Permalink
ssl support release
Browse files Browse the repository at this point in the history
  • Loading branch information
evolutionleo committed Apr 15, 2022
1 parent 8fefb0d commit c2f8d02
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions JavascriptServer/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ if (global.config.ws_enabled) {

let http_server;
if (ssl_enabled) {
trace(chalk.blueBright('ssl enabled.'));
http_server = https.createServer({
key: fs.readFileSync(ssl_key_path),
cert: fs.readFileSync(ssl_cert_path)
key: fs.readFileSync(ssl_key_path).toString(),
cert: fs.readFileSync(ssl_cert_path).toString()
});
}
else {
Expand Down Expand Up @@ -140,6 +141,10 @@ if (global.config.ws_enabled) {
});
});

ws_server.on('error', function (err) {
console.log(chalk.yellowBright('WebSocket error: ' + err.message));
});

http_server.listen(ws_port, ip, function () {
trace(chalk.bold.blueBright(`WebSocket Server running on port ${ws_port}!`));
});
Expand Down
Binary file modified Release/JSServer.zip
Binary file not shown.
Binary file modified Release/TSServer.zip
Binary file not shown.
Binary file modified Release/WebClient.zip
Binary file not shown.

0 comments on commit c2f8d02

Please sign in to comment.