Middleware framework - websocket and http