Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTTP Persistent (session reuse) capability #2261

Merged
merged 12 commits into from Aug 21, 2019
Expand Up @@ -1686,7 +1686,8 @@ RED.editor = (function() {
RED.tray.resize();
}
},
collapsible: true
collapsible: true,
menu: false
});

var nodePropertiesTab = {
Expand Down Expand Up @@ -2226,7 +2227,8 @@ RED.editor = (function() {
RED.tray.resize();
}
},
collapsible: true
collapsible: true,
menu: false
});

var nodePropertiesTab = {
Expand Down
15 changes: 9 additions & 6 deletions packages/node_modules/@node-red/editor-client/src/js/ui/view.js
Expand Up @@ -1221,12 +1221,15 @@ RED.view = (function() {
removedLinks.push(drag_lines[i].link)
}
}
historyEvent = {
t:"delete",
links: removedLinks,
dirty:RED.nodes.dirty()
};
RED.history.push(historyEvent);
if (removedLinks.length > 0) {
historyEvent = {
t:"delete",
links: removedLinks,
dirty:RED.nodes.dirty()
};
RED.history.push(historyEvent);
RED.nodes.dirty(true);
}
hideDragLines();
}
if (lasso) {
Expand Down
Expand Up @@ -67,6 +67,11 @@
</div>
</div>
</div>

<div class="form-row">
<input type="checkbox" id="node-input-persist" style="display: inline-block; width: auto; vertical-align: top;">
<label for="node-input-persist" style="width: auto" data-i18n="httpin.persist"></label>
</div>

<div class="form-row">
<input type="checkbox" id="node-input-useProxy" style="display: inline-block; width: auto; vertical-align: top;">
Expand Down Expand Up @@ -102,6 +107,7 @@
paytoqs: {value: false},
url:{value:"",validate:function(v) { return (v.trim().length === 0) || (v.indexOf("://") === -1) || (v.trim().indexOf("http") === 0)} },
tls: {type:"tls-config",required: false},
"persist":{value:true},
proxy: {type:"http proxy",required: false},
authType: {value: ""}
},
Expand Down
Expand Up @@ -29,6 +29,7 @@ module.exports = function(RED) {
var isTemplatedUrl = (nodeUrl||"").indexOf("{{") != -1;
var nodeMethod = n.method || "GET";
var paytoqs = n.paytoqs;
var nodeHTTPPersistent = n["persist"];
if (n.tls) {
var tlsNode = RED.nodes.getNode(n.tls);
}
Expand Down Expand Up @@ -94,6 +95,7 @@ module.exports = function(RED) {
opts.maxRedirects = 21;
opts.jar = request.jar();
opts.proxy = null;
opts.forever = nodeHTTPPersistent;
if (msg.requestTimeout !== undefined) {
if (isNaN(msg.requestTimeout)) {
node.warn(RED._("httpin.errors.timeout-isnan"));
Expand Down
Expand Up @@ -413,6 +413,7 @@
"digest": "digest authentication",
"bearer": "bearer authentication",
"use-proxy": "Use proxy",
"persist": "Enable connection keep-alive",
"proxy-config": "Proxy Configuration",
"use-proxyauth": "Use proxy authentication",
"noproxy-hosts": "Ignore hosts",
Expand Down