add websocket functions to send data to remote server