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";