在static function OnBeforeRequest(oSession: Session)方法内添加以下代码:
重定向:
regex:(?inx).*fxtest.fxwork.kugou.com/sns/oauth2/access_token
https://api.weixin.qq.com/sns/oauth2/access_token
static function OnBeforeRequest(oSession: Session) { //屏蔽本机 if (!String.IsNullOrEmpty(oSession["x-ProcessInfo"])) { oSession["ui-hide"] = "localprocess"; } //替换域名 //if(oSession.HostnameIs("A.com")) { // oSession.hostname="B.com"; //} //重定向 //if (oSession.fullUrl.contains("get_verify_info")) //{ // oSession.hostname="10.17.6.90:17020"; //} // Sample Rule: Color ASPX requests in RED // if (oSession.uriContains(".aspx")) { oSession["ui-color"] = "red"; } // Sample Rule: Flag POSTs to fiddler2.com in italics // if (oSession.HostnameIs("www.fiddler2.com") && oSession.HTTPMethodIs("POST")) { oSession["ui-italic"] = "yup"; } // Sample Rule: Break requests for URLs containing "/sandbox/" // if (oSession.uriContains("/sandbox/")) { // oSession.oFlags["x-breakrequest"] = "yup"; // Existence of the x-breakrequest flag creates a breakpoint; the "yup" value is unimportant. // } //修改头部 if(oSession.fullUrl.contains("doFollow")){//根据host判断 oSession.RequestHeaders.Add("type","VERIFT"); oSession.RequestHeaders.Add("data","..."); } }
static function OnBeforeResponse(oSession: Session) { if (m_Hide304s && oSession.responseCode == 304) { oSession["ui-hide"] = "true"; } if(oSession.fullUrl.contains("doFollow")){//根据host判断 oSession.ResponseHeaders.Add("type","VERIFT"); oSession.ResponseHeaders.Add("data","..."); } }