implements a  websocket client which leverages the event module