send and receive a message using WebSocket