b403d596 by Rafal Wilinski

Add Manual HTTPS support

1 parent cd5c09cb
......@@ -16,7 +16,8 @@ Monitor can be configured by passing options object into `expressMonitor` constr
Default config:
```
path: '/status',
socketPort: 41338, // Port for Socket.io communication
socketPort: 41338, // Port for Socket.io communication,
useHttps: false, // Force HTTPS protocol instead of HTTP
spans: [{
interval: 1, // Every second
retention: 60 // Keep 60 datapoints in memory
......
......@@ -136,7 +136,7 @@
Chart.defaults.global.elements.line.borderColor = "rgba(0,0,0,0.9)";
Chart.defaults.global.elements.line.borderWidth = 2;
var socket = io(window.location.protocol + '//' + window.location.hostname + ':{{port}}');
var socket = io('{{protocol}}'+ '://' + window.location.hostname + ':{{port}}');
var defaultSpan = 0;
var spans = [];
......
......@@ -10,6 +10,7 @@
const defaultConfig = {
socketPort: 41338,
path: '/status',
useHttps: false,
spans: [{
interval: 1,
retention: 60
......@@ -85,7 +86,7 @@
fs.readFile(path.join(__dirname, 'index.html'), 'utf8', (err,data) => {
if (err) throw new Error(err);
var result = data.replace(/{{port}}/g, config.socketPort);
var result = data.replace(/{{port}}/g, config.socketPort).replace(/{{protocol}}/g, config.useHttps ? 'https' : 'http');
fs.writeFile(path.join(__dirname, 'index.rendered.html'), result, 'utf8', (err) => {
if (err) throw new Error(err);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!