forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnode.js
More file actions
47 lines (33 loc) · 1.14 KB
/
Copy pathnode.js
File metadata and controls
47 lines (33 loc) · 1.14 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
42
43
44
45
46
47
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.proxy = proxy;
exports.keepAlive = keepAlive;
var _superagent = require('superagent');
var _superagent2 = _interopRequireDefault(_superagent);
var _superagentProxy = require('superagent-proxy');
var _superagentProxy2 = _interopRequireDefault(_superagentProxy);
var _agentkeepalive = require('agentkeepalive');
var _agentkeepalive2 = _interopRequireDefault(_agentkeepalive);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
(0, _superagentProxy2.default)(_superagent2.default);
function proxy(superagentConstruct) {
return superagentConstruct.proxy(this._config.proxy);
}
function keepAlive(superagentConstruct) {
var AgentClass = null;
var agent = null;
if (this._config.secure) {
AgentClass = _agentkeepalive2.default.HttpsAgent;
} else {
AgentClass = _agentkeepalive2.default;
}
if (this._config.keepAliveSettings) {
agent = new AgentClass(this._config.keepAliveSettings);
} else {
agent = new AgentClass();
}
return superagentConstruct.agent(agent);
}
//# sourceMappingURL=node.js.map