浣跨敤 FiddlerCore 鑷畾涔?HTTP/HTTPS 缃戠粶浠g悊

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了浣跨敤 FiddlerCore 鑷畾涔?HTTP/HTTPS 缃戠粶浠g悊相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/%e4%ba%8b%e4%bb%b6' title='浜嬩欢'>浜嬩欢   鏉冨▉鎸囧崡   vat   灏佽   etc   tps   request   oid   stat   

Fiddler 鏄釜寰堝ソ鐢ㄧ殑缃戠粶璇锋眰鏌ョ湅涓庤皟璇曞伐鍏凤紝杩樺彲浠ュ啓鎻掍欢鏉ユ墿灞曞叾鍔熻兘銆?/p>

Fiddler 鎻掍欢寮€鍙戯紝浣跨敤 WPF 浣滀负 UI 鎺т欢 - J.鏅掑お闃崇殑鐚?- 鍗氬鍥?/a>

浣嗛儴鍒嗗満鏅笅锛岄渶瑕佽嚜瀹氫箟寰堝缃戠粶鐩戞帶鎿嶄綔锛岄泦鎴愬埌鑷繁鐨勭▼搴忎腑銆傝繖鏃跺氨闇€瑕?FiddlerCore 浜嗐€?/p>

鍏充簬 Fiddler鐨勪娇鐢紝Fiddler鎻掍欢寮€鍙戯紝FiddlerCore 璇︾粏鐨勮鏄庯紝閮藉彲浠ョ湅 銆奆iddler鏉冨▉璋冭瘯鎸囧崡銆嬩竴涔︼紝缃戜笂鍙互鎵惧埌鐢靛瓙鐗堛€?/p>

FiddlerCore 瀹夎

FiddlerCore 鐨勬渶鏂扮増鏈槸鏀惰垂鐗堬紝浣?nuget.org 涓婂彲浠ヤ笅杞藉埌涔嬪墠鐗堟湰锛堟渶鍚庢洿鏂版椂闂达細2016-01-01锛夛紝鍩虹鐨勫姛鑳芥槸澶熺敤鐨勶紝涓嶈兘鐩存帴鎷夊彇鐨勮瘽锛屽垯闇€瑕侀厤缃湰鍦?Nuget 婧愶紝鐒跺悗鎶婅繖涓?Nuget 鍖呮斁杩涘幓銆?br /> 骞跺湪椤圭洰 csproj 鏂囦欢涓紝娣诲姞锛?/p>

    <ItemGroup>
        <PackageReference Include="FiddlerCore" Version="4.6.2.0"/>
    </ItemGroup>

FiddlerCore 瀹樼綉锛?a href="https://www.telerik.com/fiddlercore">FiddlerCore - Fiddler Proxy Engine for .NET and .NET Standard - Telerik
FiddlerCore Nuget: NuGet Gallery | FiddlerCore 4.6.2
FiddlerCore Nuget 鍖?4.6.2) 涓嬭浇鍦板潃锛?a href="https://pan.baidu.com/s/1ueTCsJ5Jv7wovCeWVN4gDw" class="uri">https://pan.baidu.com/s/1ueTCsJ5Jv7wovCeWVN4gDw

鎶€鏈浘鐗? src=

FiddlerCore 浣跨敤

FiddlerCore 鐨勪娇鐢ㄩ潪甯哥畝鍗曪紝涓昏鐨勫氨鏄?1 鍚姩浠g悊锛? 鐩戝惉浜嬩欢锛? 瀹夎璇佷功锛? 鍏抽棴浠g悊

  • 1 鍚姩浠g悊
FiddlerApplication.Startup(9898, FiddlerCoreStartupFlags.Default | FiddlerCoreStartupFlags.RegisterAsSystemProxy);

杩欓噷 FiddlerCoreStartupFlags.RegisterAsSystemProxy 鏄皢浣犵殑杩欎釜绋嬪簭锛堟垨鑰呰 127.0.0.1:9898锛夋敞鍐屼负绯荤粺浠g悊锛屾墍鏈夎蛋绯荤粺浠g悊鐨勶紝閮戒細閫氳繃姝ょ▼搴忋€?br /> 濡傛灉涓嶈缃?FiddlerCoreStartupFlags.RegisterAsSystemProxy 锛屽垯琚洃鎺х殑绋嬪簭锛岄渶瑕佹墜鍔ㄦ寚瀹氫唬鐞嗗埌 9898 杩欎釜绔彛銆?/p>

  • 2 鐩戝惉浜嬩欢
FiddlerApplication.BeforeRequest += FiddlerApplication_BeforeRequest;
FiddlerApplication.BeforeResponse += FiddlerApplication_BeforeResponse;

private static void FiddlerApplication_BeforeResponse(Session oSession)
{
}

private static void FiddlerApplication_BeforeRequest(Session oSession)
{
}

閫氳繃杩欎袱涓簨浠讹紝灏卞彲浠ユ嬁鍒?FiddlerCore 鎵€鎴幏鐨勮姹傘€傜劧鍚庤繘琛屾搷浣滄垨鑰呰褰曘€?/p>

鎶€鏈浘鐗? src=

  • 3 瀹夎璇佷功

濡傛灉闇€瑕佺洃鍚?HTTPS 璇锋眰锛岄渶瑕佸畨瑁呰瘉涔︼紝瀹夎璇佷功鏃讹紝浼氭湁涓€涓脊绐楋紝璁╃敤鎴峰悓鎰忋€?/p>

// 瀹夎璇佷功
public static bool InstallCertificate()
{
    if (!CertMaker.rootCertExists())
    {
        if (!CertMaker.createRootCert())
            return false;

        if (!CertMaker.trustRootCert())
            return false;
    }

    return true;
}
// 鍗歌浇璇佷功
public static bool UninstallCertificate()
{
    if (CertMaker.rootCertExists())
    {
        if (!CertMaker.removeFiddlerGeneratedCerts(true))
            return false;
    }
    return true;
}

鎶€鏈浘鐗? src=

  • 4 鍏抽棴浠g悊

杩欑偣寰堥噸瑕侊紝鍥犱负濡傛灉绋嬪簭缁撴潫涔嬪悗浠g悊涓嶅叧闂紝鍒欐棤娉曟甯镐笂缃戙€傦紙鍥犱负璁剧疆浜嗕唬鐞嗭紝浣嗕唬鐞嗙▼搴忓叧闂簡銆傦級

if (FiddlerApplication.IsStarted())
{
    FiddlerApplication.Shutdown();
}

鍦ㄧ湡姝d娇鐢ㄧ殑鏃跺€欙紝浠ヤ笂杩欎簺鎿嶄綔锛屽缓璁仛涓€灞傛娊璞″拰灏佽锛屼笉鐒朵笟鍔″拰缃戠粶鐩戞帶鐨勪唬鐮佷細鑰﹀悎鐨勫お绱с€?/p>

鏇村鍏充簬缃戠粶娴嬭瘯涓庣洃鎺х殑瀹炵幇锛屽彲浠ュ弬鑰冭繖涓」鐩細
RickStrahl/WestWindWebSurge: Quick and easy URL and Load Testing for your Web applications on Windows

浣跨敤FiddlerCore鏉ユ祴璇昗ebAPI - 鐙笂楂樻ゼ - 鍗氬鍥?/a>
  • Using FiddlerCore to capture HTTP Requests with .NET - Rick Strahl鈥榮 Web Log
  • Fiddler璋冭瘯鏉冨▉鎸囧崡
  • 鍘熸枃閾炬帴锛?a href="https://www.cnblogs.com/jasongrass/p/12044321.html" class="uri">https://www.cnblogs.com/jasongrass/p/12044321.html

    以上是关于浣跨敤 FiddlerCore 鑷畾涔?HTTP/HTTPS 缃戠粶浠g悊的主要内容,如果未能解决你的问题,请参考以下文章

    matlab鑷甫鍚勭鍒嗙被鍣ㄧ殑浣跨敤绀轰緥

    Springboot鑷姩鍔犺浇宸ュ叿-devtools鐨勭悊瑙d笌浣跨敤

    notepad + +浣跨敤姝ラ

    iOS swift ipad浣跨敤绯荤粺鑷甫鍒嗕韩 寮规澶辫触娌℃湁寮规

    Asp.Net浣跨敤Yahoo.Yui.Compressor.dll鍘嬬缉Js|Css

    Linux(CentOS)浣跨敤瀹氭椂浠诲姟鍒犻櫎Tomcat鏃ュ織鏂囦欢