setProxy method

dynamic setProxy(
  1. String proxy
)

Implementation

setProxy(String proxy) {
  (httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
      (client) {
    // config the http client
    client.findProxy = (uri) {
      // proxy all request to localhost:8888
      return "PROXY $proxy";
    };
    // you can also create a HttpClient to dio
    // return HttpClient();
  };
}