Fiddler小记

1、域名映射ip和port两种方式

     a、Customize Rules:OnBeforeRequest方法中添加如下代码

if (oSession.HostnameIs("msg.xxxxxx.com"))
        {
            oSession.host = "172.172.178.47";
            oSession.port = 8081;
        }

 

   b、AutoResponder中正则表达式替换

       regex:http://msg.xxxxxx.com/(.*)   --->  http://172.172.180.1:8081/$1

2、显示IP字段 

     Rules-Customize Rules

     在main方法中添加代码

     FiddlerObject.UI.lvSessions.AddBoundColumn("Server IP", 120, "X-HostIP");

    完整代码:

 static function Main() {
        var today: Date = new Date();
        FiddlerObject.StatusText = " CustomRules.js was loaded at: " + today;
        // Uncomment to add a "Server" column containing the response "Server" header, if present
        FiddlerObject.UI.lvSessions.AddBoundColumn("Server IP", 120, "X-HostIP");
    }

3、调试单个request

    在命令行中输入命令: bpu http://www.qq.com,这种方法只会中断http://www.qq.com,消除断点的方法就是在命令行中输入命令 bpu。

  • bpu在请求开始时中断,

  • bpafter在响应到达时中断,

  • bps在特定http状态码时中断,

  • bpv/bpm在特定请求method时中断。

    参考资料:http://my.oschina.net/leejun2005/blog/399108

4、HTTPS请求(需要下载fiddlercertmaker.exe插件)

    参考资料http://blog.csdn.net/justfwd/article/details/43988559

    http://blog.csdn.net/roland_sun/article/details/30078353

5、浏览器抓包:

tools->WinINET Options->然后选中“对所有协议都设置相同的代理服务器”并设置127.0.0.1:8888。注意如果浏览器设置了其他代理插件,可能需要把插件禁用。

6、AutoResponder乱码

方案1:在Raw面板中把头部信息copy到xxx.txt文件中,与body空一行。并添加Content-Type: application/json; charset=utf-8

方案2:统一修改Response Headers,打开Customize Rules

在OnBeforeResponse方法中添加

 oSession.oResponse.headers["Content-Type"] = oSession.oResponse.headers["Content-Type"] + ";application/json;charset=utf-8";

或者在OnPeekAtResponseHeaders方法中直接设置Content-Type

oSession.oResponse["Content-Type"] = "application/json; charset=utf-8";

 

转载于:https://my.oschina.net/bruces/blog/662869

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值