diff options
author | seebees <seebees@gmail.com> | 2011-10-19 16:28:44 -0700 |
---|---|---|
committer | koichik <koichik@improvement.jp> | 2011-10-22 14:14:40 +0900 |
commit | 216570b5e1b1263083f145566112d3f343a2264b (patch) | |
tree | 955b507135ec2a58fa616c93cf0848f3419487ea /doc | |
parent | a2eaddaa514847aff5557223d9cd2b537d9017eb (diff) | |
download | node-new-216570b5e1b1263083f145566112d3f343a2264b.tar.gz |
Lint
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/http.markdown | 20 | ||||
-rw-r--r-- | doc/api/https.markdown | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 7d5b9b5215..4cef0c847f 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -487,21 +487,21 @@ Example: ## http.Agent -In node 0.5.3+ there is a new implementation of the HTTP Agent which is used +In node 0.5.3+ there is a new implementation of the HTTP Agent which is used for pooling sockets used in HTTP client requests. -Previously, a single agent instance help the pool for single host+port. The +Previously, a single agent instance help the pool for single host+port. The current implementation now holds sockets for any number of hosts. -The current HTTP Agent also defaults client requests to using -Connection:keep-alive. If no pending HTTP requests are waiting on a socket -to become free the socket is closed. This means that node's pool has the -benefit of keep-alive when under load but still does not require developers +The current HTTP Agent also defaults client requests to using +Connection:keep-alive. If no pending HTTP requests are waiting on a socket +to become free the socket is closed. This means that node's pool has the +benefit of keep-alive when under load but still does not require developers to manually close the HTTP clients using keep-alive. -Sockets are removed from the agent's pool when the socket emits either a -"close" event or a special "agentRemove" event. This means that if you intend -to keep one HTTP request open for a long time and don't want it to stay in the +Sockets are removed from the agent's pool when the socket emits either a +"close" event or a special "agentRemove" event. This means that if you intend +to keep one HTTP request open for a long time and don't want it to stay in the pool you can do something along the lines of: http.get(options, function(res) { @@ -509,7 +509,7 @@ pool you can do something along the lines of: }).on("socket", function (socket) { socket.emit("agentRemove"); }); - + Alternatively, you could just opt out of pooling entirely using `agent:false`: http.get({host:'localhost', port:80, path:'/', agent:false}, function (res) { diff --git a/doc/api/https.markdown b/doc/api/https.markdown index 7a5473cf84..4113fe06e3 100644 --- a/doc/api/https.markdown +++ b/doc/api/https.markdown @@ -69,7 +69,7 @@ The options argument has the following options - method: HTTP request method. Default `'GET'`. The following options can also be specified. -However, a global [Agent](http.html#http.Agent) cannot be used. +However, a global [Agent](http.html#http.Agent) cannot be used. - key: Private key to use for SSL. Default `null`. - cert: Public x509 certificate to use. Default `null`. |