Implements interaction of websocket