Add websocket support, close #865