When switching from http to ws, only replace first http occurrence in the url