securely connect to web socket