added code so that a client can communicate via websocket