使用fiddler抓包,有的http请求抓不到数据显示443,很费解!但是有的就可以,偶遇如下解决方案,试了下解决了。道声谢!!!
前提装好fiddler配置好代理,然后安装好证书
找到右侧选项卡: FiddlerScript
> Go to
> 下拉选择 OnBeforeRequest
,把下边代码贴在方法的最后边,保存!
var hosts = 'zkd.me develop.dog';
FiddlerApplication.Log.LogFormat("Logger session {0}, Url: {1}, isHttps: {2}, port: {3}", oSession.id, oSession.fullUrl, oSession.isHTTPS, oSession.port);
if (hosts.indexOf(oSession.host) > -1) {
FiddlerApplication.Log.LogFormat("Capture session {0}, Url: {1}, isHttps: {2}, port: {3}", oSession.id, oSession.fullUrl, oSession.isHTTPS, oSession.port);
if (oSession.HTTPMethodIs('CONNECT')) {
FiddlerApplication.Log.LogString('create fake tunnel response');
oSession['x-replywithtunnel'] = 'FakeTunnel';
return;
}
if (oSession.isHTTPS) {
FiddlerApplication.Log.LogString('switch https to http request');
oSession.fullUrl = oSession.fullUrl.Replace("https://", "http://");
oSession.port = 80;
}
FiddlerApplication.Log.LogFormat("Processed session {0}, Url: {1}, isHttps: {2}, port: {3}", oSession.id, oSession.fullUrl, oSession.isHTTPS, oSession.port);
}
FiddlerApplication.Log.LogFormat("Logger session {0}, Url: {1}, isHttps: {2}, port: {3}", oSession.id, oSession.fullUrl, oSession.isHTTPS, oSession.port);
参考: