add middleware for connect
Merge pull request #2 from maxbbn/master

add middleware for connect