dio 代理

(_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
        (client) {
      client.findProxy = (url) {
        ///设置代理 电脑ip地址
        return "PROXY 127.0.0.1:8888";

        ///不设置代理
        // return 'DIRECT';
      };

      ///忽略证书
      client.badCertificateCallback =
          (X509Certificate cert, String host, int port) => true;
    };

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