Skip to content

Instantly share code, notes, and snippets.

@MarshalW
Last active January 22, 2021 12:26
Show Gist options
  • Select an option

  • Save MarshalW/68e30567d2e1b81865a2adbd08df57cc to your computer and use it in GitHub Desktop.

Select an option

Save MarshalW/68e30567d2e1b81865a2adbd08df57cc to your computer and use it in GitHub Desktop.
charles的基本使用

charles的基本使用

目前版本是v4.6.1

  • session
    • 所有活动都是在sesion中
    • 可保存session到文件
    • 可将保存的session文件加载到charles
  • recording
    • charles最基本的功能,记录请求/响应对
    • record记录在当前的sesion中
    • 可关闭recording,依然能代理,但不在session中记录
  • request/response
    • 组成record的基本单位
    • 可通过两种视图查看record列表
      • structure,用于查看record隶属于网站域名
      • sequence,按照时间顺序显示record
  • chart
    • 以图的形式显示加载资源(请求/响应)的先后次序和耗时
    • 可以将chart导出为图片
  • ssl certificates
    • 可给操作系统或者应用创建根证书
    • 将charles的根证书设置给系统后,https代理在浏览器中就不会报错了
    • 用于ssl proxy
  • throtting,带宽模拟器,用于对低带宽条件的模拟和测试
  • ssl proxy
    • 一个很重要的功能,因为现在大多数web系统都是https的了
    • 不使用ssl proxy依然可以代理访问目标网站,但是因为https造成的信道加密
      • 看不到访问的路径,头信息和请求参数等
      • 请求和响应都是加密数据,无法看到
  • breakpoints,可用于对request/response实时修改,用于调试/测试
  • 工具
    • no caching,去除request/response缓存头信息,增加不缓存的头信息,使客户端每次都取最新的数据
    • 阻止cookie,可用于模拟网络爬虫的访问,因为后者一般不带cookie
    • map remote,将远程链接映射为其他链接,比如将生产站的css相关url映射到开发站的url
    • map local,将代理服务器本地文件映射为远程url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment