Middleware for connect to allow arbitrary preprocessing (with streams!)