Skip to content
This repository was archived by the owner on Jul 9, 2019. It is now read-only.

Commit acb79b5

Browse files
committed
[STABLE] Allow HTTPS and HTTP and MQTT and SSL MQTT
1 parent 616a909 commit acb79b5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var onReady = require("./on_ready");
44
var maybeEnableSSL = require("./security/maybe_enable_ssl");
55

66
var input = {
7+
allowNonSecure: true,
78
port: conf.mqttPort,
89
http: { // for teh websockets
910
port: conf.httpPort,
@@ -16,7 +17,9 @@ maybeEnableSSL(input)
1617
var server = new Server(input);
1718

1819
server.on("ready", onReady(server)); //on init it fires up setup()
19-
20+
server.on("ready", function() {
21+
console.dir(input);
22+
});
2023
var authorizePublish = require("./security/authorize_publish");
2124
var authorizeSubscribe = require("./security/authorize_subscribe");
2225
server.authorizePublish = authorizePublish;

app/security/maybe_enable_ssl.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var SSL = process.env.SSL_DOMAIN;
22
// ALL OF THESE HARDCODED VALUES ARE SET BY LETS ENCTRYPT/
33
// CERTBOT. <3 EFF
44
var SSL_DIR = `/etc/letsencrypt/live/${SSL}/`;
5-
// var SSL_MQTT_PORT = 8883;
5+
var SSL_MQTT_PORT = 8883;
66
var HTTPS_PORT = 443;
77
var SSL_CERT = SSL_DIR + "cert.pem";
88
var SSL_KEY = SSL_DIR + "privkey.pem";
@@ -11,7 +11,7 @@ var log = require("../logger");
1111
module.exports = function maybeEnableSSL(config) {
1212
if (SSL) {
1313
config.secure = config.secure || {};
14-
// config.secure.port = SSL_MQTT_PORT;
14+
config.secure.port = SSL_MQTT_PORT;
1515
config.secure.keyPath = SSL_KEY;
1616
config.secure.certPath = SSL_CERT;
1717

0 commit comments

Comments
 (0)