Websocket functions in Erlang, mostly for a client