Derive a websocket url from a http(s) or protocol relative url