Added agent websocket client code