Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jul 23, 2012
1 parent 3d77c94 commit 52ffb24
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions Readme.md
@@ -1,36 +1,2 @@
# Connect-timeout middleware

Connect timeout sets a global timeout for responses.

## Usage

connect.createServer(
require('./path/to/connect-timeout')({options})
)

### Options

#### Code

Error code to respond with in case of timeout (500)

#### Time

Number of ms after which the timeout is triggered (8000)

## What about long-running requests?

When the timeout is enabled, a `clearTimeout` method is attached to the request.

function(req, res, next){
req.clearTimeout();
setTimeout(function(){
res.writeHead(200);
res.end();
// this will work
}, 20000);
}

## Author

Guillermo Rauch <guillermo@learnboost.com>
Use connect's bundled `connect.timeout(ms)`

0 comments on commit 52ffb24

Please sign in to comment.