其他分享
首页 > 其他分享> > fiddler自定义显示目标IP和时间

fiddler自定义显示目标IP和时间

作者:互联网

点击菜单栏Rules->CustomRules然后按Ctrl+F搜索 static function Main() 即可看到如下内容,粘贴规则:

 // The Main() function runs everytime your FiddlerScript compiles
static function Main() {
var today: Date = new Date();
FiddlerObject.StatusText = " CustomRules.js was loaded at: " + today;
//显示请求的目标IP地址,复制下面这行贴上
FiddlerObject.UI.lvSessions.AddBoundColumn("ServerIP", 120, "X-HostIP");

点击菜单栏Rules->CustomRules然后按Ctrl+F搜索 class Handlers{ 即可看到如下的内容,继续粘贴规则:

class Handlers
{
/*中间一大段注释内容不再复制*/
//添加响应时间开始
function BeginRequestTime(oS: Session)
{
if (oS.Timers != null)
{
return oS.Timers.ClientBeginRequest.ToString();
}
return String.Empty;
}
public static BindUIColumn("Time Taken")
function CalcTimingCol(oS: Session){
var sResult = String.Empty;
if ((oS.Timers.ServerDoneResponse > oS.Timers.ClientDoneRequest))
{
sResult = (oS.Timers.ServerDoneResponse - oS.Timers.ClientDoneRequest).ToString();
}
return sResult;
}
//添加响应时间结束

标签:function,fiddler,自定义,IP,sResult,Timers,static,Main,oS
来源: https://www.cnblogs.com/ldsice/p/11106248.html