When the client connects to a WebSocket server, the server can return an HTTP Response Code 30x. If the Response code it's a 301, means that the location has been moved permanently, and the new url is informed in the Location HTTP Header.
The WebSocket client, handle redirections automatically, so if detects the Server Response contains a redirection, it will disconnect the actual connection and attempts to connect with then new Location URL.