// Server listen blocks
conf.servers = [];
+// Example plain-text server block
+conf.servers.push({
+ port: 7778,
+ address: "0.0.0.0"
+});
+
// Example SSL server block
conf.servers.push({
port: 7777,
address: "0.0.0.0",
- secure: true,
+ ssl: true,
ssl_key: "server.key",
ssl_cert: "cert.pem"
});
-// Example plain-text server block
-conf.servers.push({
- secure: false,
- port: 7778,
- address: "0.0.0.0"
-});
// Where the client files are
conf.public_http = "client/";
http_handler = new HttpHandler(config);
- if (config.secure) {
+ if (config.ssl) {
opts = {
key: fs.readFileSync(__dirname + '/' + config.ssl_key),
cert: fs.readFileSync(__dirname + '/' + config.ssl_cert)
hs = https.createServer(opts, handleHttpRequest);
// Start socket.io listening on this weblistener
- this.ws = ws.listen(hs, {secure: true});
+ this.ws = ws.listen(hs, {ssl: true});
hs.listen(config.port, config.address);
console.log('Listening on ' + config.address + ':' + config.port.toString() + ' with SSL');
hs = http.createServer(handleHttpRequest);
// Start socket.io listening on this weblistener
- this.ws = ws.listen(hs, {secure: false});
+ this.ws = ws.listen(hs, {ssl: false});
hs.listen(config.port, config.address);
console.log('Listening on ' + config.address + ':' + config.port.toString() + ' without SSL');