dio代理设置

(dio.httpClientAdapter as DefaultHttpClientAdapter)
    .onHttpClientCreate = (client) {
  // config the http client
  client.findProxy = (uri) {
    //proxy all request to localhost:8888
    return "192.168.115.229:8888";
  };
  client.badCertificateCallback =
      (X509Certificate cert, String host, int port) => true;
  // you can also create a new HttpClient to dio
  // return new HttpClient();
};

你可能感兴趣的:(dio代理设置)