Setting object to the WebSocket