websocket connections respect SSL config

now support secure websockets (wss)
tidy up comments