add message from server.js to client.js about end of user connection to public + refactor client.js for correct handling frames