charles 的使用
2017-12-04 本文已影响14人
海阔天空domybest
HTTP抓包
- mobile设备 Wi-Fi 连接->高级选项->代理->手动

- 代理服务器主机名填入电脑端的ip地址
- 代理服务器端口填入8888
- 保存
晚上上述步骤后即可在charles上查看到内容

HTTPS抓包
- charles -> Help -> SSL Proxying -> Install Charles Root Certificate on a Mobile Device

-
可以看到提示网址: chls.pro/ssl, 在移动设备端输入该网址即可完成自动下载并安装证书
-
Proxy -> SSL Proxying Settings...

- 在上述界面点击【add】,把需要监控的host添加进来,端口号填443
完成上述操作之后,就可以看到【add】进来的host的请求/返回结果
-
如何拦截请求/返回,修改请求/返回数据
右键选择需要拦截的url,选中[Breakpoints]
image.png
再次请求该url,会弹出下面的界面

在[Edit Request]中修改请求参数,之后再点击[Execute]即可继续网络请求访问。
会再次弹出界面

点击[Edit Response],对返回数据进行拦截修改,点击[Execute]执行。