Skip to content

Commit c76a33d

Browse files
committed
Update to use http vs https nodejs package based on config
1 parent 0159c06 commit c76a33d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tulip_machine_attribute.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ module.exports = function (RED) {
33

44
const request = require('request');
55
const https = require('https');
6+
const http = require('http');
7+
const httpLibs = {
8+
http,
9+
https
10+
}
611
const { v4: uuidv4 } = require('uuid');
712

813
// Tulip API node
@@ -15,7 +20,7 @@ module.exports = function (RED) {
1520
this.deviceInfo = JSON.parse(config.deviceInfo);
1621
this.payloadSource = config.payloadSource;
1722
this.payloadType = config.payloadType;
18-
this.agent = new https.Agent({
23+
this.agent = new httpLibs[apiAuthNode.protocol].Agent({
1924
keepAlive: config.keepAlive,
2025
keepAliveMsecs: config.keepAliveMsecs,
2126
});

0 commit comments

Comments
 (0)