modified encoder of WS server endpoint