use wss in https, use http in other protocols

`wss` only works in `https` while `ws` can work in other common protocols.