senchalabs/connect — pull request #701 by guybedford (2012-12-06 08:14:14+00:00)
Title: Allowing connect to be used as middleware

As in #697.

Let me know if you would like a test case as well.

This allows me to write the following code:

```javascript
var connect = require('connect'),
http = require('http');

var serverHandler = my_async_handler_generator();
var connectHandler = connect();

myHandler.on(function(req, res, next) {
console.log('This handler comes before anything else');
next();
});

myHandler.on(connectHandler);

myHandler.on(function(req, res, next) {
res.writeHead(200, {
'Content-Type': 'text/plain'
});
res.end('This is the next fall through after the connect handlers');
});

http.createServer(myHandler).listen(8080);
```