Skip to content
This repository
Browse code

Expose http.getAgent

  • Loading branch information...
commit b9574b995fb48219d8f4e1641f8730e10f2c9f3c 1 parent db8736a
ry ry authored

Showing 3 changed files with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  doc/api/http.markdown
  2. +1 0  lib/http.js
  3. +1 0  lib/https.js
3  doc/api/http.markdown
Source Rendered
@@ -394,11 +394,12 @@ Example:
394 394
395 395
396 396 ## http.Agent
  397 +## http.getAgent(host, port)
397 398
398 399 `http.request()` uses a special `Agent` for managing multiple connections to
399 400 an HTTP server. Normally `Agent` instances should not be exposed to user
400 401 code, however in certain situations it's useful to check the status of the
401   -agent.
  402 +agent. The `http.getAgent()` function allows you to access the agents.
402 403
403 404 ### Event: 'upgrade'
404 405
1  lib/http.js
@@ -1148,6 +1148,7 @@ function getAgent(host, port) {
1148 1148
1149 1149 return agent;
1150 1150 }
  1151 +exports.getAgent = getAgent;
1151 1152
1152 1153
1153 1154 exports._requestFromAgent = function(agent, options, cb) {
1  lib/https.js
@@ -55,6 +55,7 @@ function getAgent(options) {
55 55
56 56 return agent;
57 57 }
  58 +exports.getAgent = getAgent;
58 59
59 60
60 61 exports.request = function(options, cb) {

0 comments on commit b9574b9

Please sign in to comment.
Something went wrong with that request. Please try again.