add encoder for websocket
fix websocket encoder/decoder