buildServerAddress function
Implementation
Uri buildServerAddress(String input, bool secure, {bool webSockets = true}) {
final splitted = input.split(':');
return Uri(
scheme: (webSockets ? 'ws' : 'http') + (secure ? 's' : ''),
host: splitted[0],
port: splitted.length <= 1 ? kDefaultPort : int.parse(splitted[1]),
);
}