FlutterFlutterFlutter

Flutter Dio Charles抓包设置

2021-03-29  本文已影响0人  倪大头

正常抓是不走代理的,需要给dio对象配置代理:

Dio dio = Dio();
    
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (HttpClient client) {
  client.findProxy = (uri) {
    return "PROXY localhost:8888";
  };
};

localhost mac电脑可以用ifconfig命令看,或者直接在Charles——>Help——>Local IP Address


image.png
上一篇 下一篇

猜你喜欢

热点阅读