首页 > 代码库 > Fiddler 4 抓包

Fiddler 4 抓包

Fiddler 4

Tools –> Fiddler Options

HTTPS -> 勾选“CaptureHTTPS CONNECTs”,同时勾选“Decrypt HTTPS traffic”, 选择“…fromremote clients only” , 勾选 “Ignore servercertificate errors” 

Conections -> 勾选“Allow remote computersto connect”

//Customize Rules 
//在class Handlers中加入以下代码 可以在Fiddler右边栏的Log标签里,看到WebSocket的数据包
static function OnWebSocketMessage(oMsg: WebSocketMessage) {
    FiddlerApplication.Log.LogString(oMsg.ToString());
}

//在函数OnBeforeResponse里面添加下面代码:
if (oSession.oRequest["User-Agent"].indexOf("Android") > -1 && oSession.HTTPMethodIs("CONNECT")) {
            oSession.oResponse.headers["Connection"] = "Keep-Alive";
}

//修改后
static function OnBeforeResponse(oSession: Session) {
        if (m_Hide304s && oSession.responseCode == 304) {
            oSession["ui-hide"] = "true";
        }
        if (oSession.oRequest["User-Agent"].indexOf("Android") > -1 && oSession.HTTPMethodIs("CONNECT")) {
            oSession.oResponse.headers["Connection"] = "Keep-Alive";
        }
    }

手机打开网页下载证书 Fiddler Root certificate

 

Fiddler 4 抓包