client: use wss if protocol is https. closes #282