Right now we have a devtools.recordreplay.cloudServer preference, which is the address of a websocket server to connect to when creating a remote replaying process. So far I've just been using this preference as the raw IP of the AWS server listening for connections, but this won't work as we move forward and have multiple servers or bring them up and down at different times.
One way of dealing with this would be to have the cloud server redirect incoming connections as it sees fit. It doesn't seem like this works with websockets though (https://stackoverflow.com/questions/46962881/is-it-possible-to-seamlessly-redirect-websockets) and that managing this from the client is the preferred approach. A simple way of doing this is to have the cloud server address return another address at which the actual cloud connection should be made. This will almost certainly change in the future when we add authentication but seems a good intermediate step for now. The attached patch makes this change and some associated cleanups in connection-worker.js