mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2261 from eeyepee/master
Add HTTP Persistent (session reuse) capability
This commit is contained in:
commit
311c7b1158
@ -1763,7 +1763,8 @@ RED.editor = (function() {
|
||||
RED.tray.resize();
|
||||
}
|
||||
},
|
||||
collapsible: true
|
||||
collapsible: true,
|
||||
menu: false
|
||||
});
|
||||
|
||||
var nodePropertiesTab = {
|
||||
@ -2339,7 +2340,8 @@ RED.editor = (function() {
|
||||
RED.tray.resize();
|
||||
}
|
||||
},
|
||||
collapsible: true
|
||||
collapsible: true,
|
||||
menu: false
|
||||
});
|
||||
|
||||
var nodePropertiesTab = {
|
||||
|
@ -1292,12 +1292,15 @@ RED.view = (function() {
|
||||
removedLinks.push(drag_lines[i].link)
|
||||
}
|
||||
}
|
||||
if (removedLinks.length > 0) {
|
||||
historyEvent = {
|
||||
t:"delete",
|
||||
links: removedLinks,
|
||||
dirty:RED.nodes.dirty()
|
||||
};
|
||||
RED.history.push(historyEvent);
|
||||
RED.nodes.dirty(true);
|
||||
}
|
||||
hideDragLines();
|
||||
}
|
||||
if (lasso) {
|
||||
|
@ -68,6 +68,11 @@
|
||||
</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;">
|
||||
<label for="node-input-useProxy" style="width: auto;"><span data-i18n="httpin.use-proxy"></span></label>
|
||||
@ -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: ""}
|
||||
},
|
||||
|
@ -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);
|
||||
}
|
||||
@ -96,6 +97,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"));
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user