websocket rewrite