How can run a client by taking the string from the console, encoding it to the respective record and emitting it to the server?