How to use the Agent function from http
Find comprehensive JavaScript http.Agent code examples handpicked from public code repositorys.
50 51 52 53 54 55 56 57 58 59
maxContentLength: (((1024 * 1024) * 1024) * 1024), maxBodyLength: (((1024 * 1024) * 1024) * 1024), httpsAgent: new https.Agent({ keepAlive: true }), httpAgent: new http.Agent({ keepAlive: true }), proxy: false, headers: {
24
118
8
GitHub: manuel-serrano/hop
87 88 89 90 91 92 93 94 95 96
return tls.connect(options); } function Agent(options) { http.Agent.call(this, options); this.createConnection = createConnection; } inherits(Agent, http.Agent); Agent.prototype.defaultPort = 443;
14
113
10
GitHub: kinka/whistle
1 2 3 4 5 6 7 8 9 10
var os = require('os'); var http = require('http'); var crypto = require('crypto'); var qs = require('querystring'); var LRU = require('lru-cache'); var httpAgent = http.Agent; var httpsAgent = require('https').Agent; var url = require('url'); var fse = require('fs-extra2'); var Buffer = require('safe-buffer').Buffer;
0
1
1
+ 5 other calls in file
340 341 342 343 344 345 346 347 348 349
+ }, common.platformTimeout(500)); +}, 2)); + +server.keepAliveTimeout = common.platformTimeout(200); + +const agent = new http.Agent({ + keepAlive: true, + maxSockets: 1 +}); +
11
0
1
3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648
http.IncomingMessage = response.IncomingMessage http.Agent = function () {} http.Agent.defaultMaxSockets = 4 http.globalAgent = new http.Agent() http.STATUS_CODES = statusCodes http.METHODS = [
0
0
1
+ 4 other calls in file
GitHub: 131/docker-sdk
59 60 61 62 63 64 65 66 67 68
this.request = this.request.bind(this); this.request.agent = agent; } sshlnk(target) { const agent = new http.Agent(); let lnk; let locker = keepAliveMgr(function() {
0
0
2
GitHub: Harshjha123/cashwin
49 50 51 52 53 54 55 56 57 58 59 60
serverApi: ServerApiVersion.v1, }); const server = http.createServer(app) var agent = new http.Agent({ keepAlive: true, maxSockets: 1, keepAliveMsecs: 3000 })
0
0
1
GitHub: codenvy-demos/io.js
70 71 72 73 74 75 76 77 78 79
} inherits(Agent, http.Agent); Agent.prototype.createConnection = createConnection; Agent.prototype.getName = function(options) { var name = http.Agent.prototype.getName.call(this, options); name += ':'; if (options.ca) name += options.ca;
0
0
4
+ 3 other calls in file
http.createServer is the most popular function in http (322 examples)