forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.js
More file actions
41 lines (30 loc) · 1.15 KB
/
Copy pathnode.js
File metadata and controls
41 lines (30 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.proxy = proxy;
exports.keepAlive = keepAlive;
var _superagent = _interopRequireDefault(require("superagent"));
var _superagentProxy = _interopRequireDefault(require("superagent-proxy"));
var _agentkeepalive = _interopRequireDefault(require("agentkeepalive"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var keepAliveAgent = null;
var keepAliveSecureAgent = null;
(0, _superagentProxy["default"])(_superagent["default"]);
function proxy(superagentConstruct) {
return superagentConstruct.proxy(this._config.proxy);
}
function keepAlive(superagentConstruct) {
var agent = this._config.secure ? keepAliveSecureAgent : keepAliveAgent;
if (agent === null) {
var AgentClass = this._config.secure ? _agentkeepalive["default"].HttpsAgent : _agentkeepalive["default"];
agent = new AgentClass(this._config.keepAliveSettings);
if (this._config.secure) {
keepAliveSecureAgent = agent;
} else {
keepAliveAgent = agent;
}
}
return superagentConstruct.agent(agent);
}
//# sourceMappingURL=node.js.map