settingProxy static method

Uri settingProxy(
  1. Uri uri
)

Implementation

static Uri settingProxy(Uri uri) {
  var url = uri;

  if (foundation.kIsWeb &&
      '$url'.contains(HttpClientSetting.webProxy) == false) {
    final urlText =
        '$url'.replaceAll('http://', '').replaceAll('https://', '');

    final proxyURL = '${HttpClientSetting.webProxy}$urlText';
    url = Uri.parse(proxyURL);
  }

  return url;
}