Change server url while using web version

Hi there, im trying to add possibility for end users to select a remote server url in web, like how it is done in mobile. But in web the process is slightly different as i understand, and for my shame im not able to figure out how to implement it :frowning:

Any help/explanation how it works would be great