Expose http.getAgent
This commit is contained in:
parent
db8736ad93
commit
b9574b995f
@ -394,11 +394,12 @@ Example:
|
|||||||
|
|
||||||
|
|
||||||
## http.Agent
|
## http.Agent
|
||||||
|
## http.getAgent(host, port)
|
||||||
|
|
||||||
`http.request()` uses a special `Agent` for managing multiple connections to
|
`http.request()` uses a special `Agent` for managing multiple connections to
|
||||||
an HTTP server. Normally `Agent` instances should not be exposed to user
|
an HTTP server. Normally `Agent` instances should not be exposed to user
|
||||||
code, however in certain situations it's useful to check the status of the
|
code, however in certain situations it's useful to check the status of the
|
||||||
agent.
|
agent. The `http.getAgent()` function allows you to access the agents.
|
||||||
|
|
||||||
### Event: 'upgrade'
|
### Event: 'upgrade'
|
||||||
|
|
||||||
|
@ -1148,6 +1148,7 @@ function getAgent(host, port) {
|
|||||||
|
|
||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
|
exports.getAgent = getAgent;
|
||||||
|
|
||||||
|
|
||||||
exports._requestFromAgent = function(agent, options, cb) {
|
exports._requestFromAgent = function(agent, options, cb) {
|
||||||
|
@ -55,6 +55,7 @@ function getAgent(options) {
|
|||||||
|
|
||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
|
exports.getAgent = getAgent;
|
||||||
|
|
||||||
|
|
||||||
exports.request = function(options, cb) {
|
exports.request = function(options, cb) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user