我的代码目前捕获所有浏览器流量,但我想捕获目标进程(浏览器)
我使用Process.Start启动浏览器,然后我只需要此浏览器流量。
private void InitializeFiddler()
{
FiddlerApplication.Shutdown();
FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
FiddlerApplication.Startup(8888, FiddlerCoreStartupFlags.Default);
WebProxy myProxy = new WebProxy();
Uri newUri = new Uri("http://localhost:8888");
myProxy.Address = newUri;
Process.Start("http://stackoverflow.com/");
}
private void FiddlerApplication_AfterSessionComplete(Session oSession)
{
if (oSession.fullUrl.Contains(".mp3"))
{
_streamUrl = oSession.fullUrl.Substring(0, oSession.fullUrl.Length - 5); ;
}
}
答案 0 :(得分:3)
我找到了答案:
private void FiddlerApplication_AfterSessionComplete(Session oSession)
{
if (oSession.LocalProcessID == 1234)
{
//
}
}