Added option to use custom preprocess middleware.

Pass a middleware as ```preprocess``` option to ```PeerServer```.