public KanColleModel() { FiddlerApplication.Startup(0, FiddlerCoreStartupFlags.ChainToUpstreamGateway); URLMonInterop.SetProxyInProcess(string.Format("127.0.0.1:{0}", FiddlerApplication.oProxy.ListenPort), "<local>"); kclib = new KanColleNotifier(true); kclib.GameStart += (_, __) => OnGameStart(new EventArgs()); kclib.GetStart2 += kclib_GetStart2; kclib.GetPortPort += kclib_GetPortPort; kclib.GetGetmemberBasic += kclib_GetGetmemberBasic; kclib.GetGetmemberShip2 += kclib_GetGetmemberShip2; kclib.GetGetmemberShip3 += kclib_GetGetmemberShip3; kclib.GetGetmemberDeck += kclib_GetGetmemberDeck; kclib.GetReqmissionStart += kclib_GetReqmissionStart; kclib.GetReqmissionReturnInstruction += kclib_GetReqmissionReturnInstruction; kclib.GetGetmemberKdock += kclib_GetGetmemberKdock; kclib.GetReqkousyouGetship += kclib_GetReqkousyouGetship; kclib.GetGetmemberNdock += kclib_GetGetmemberNdock; kclib.GetReqkousyouDestroyship += kclib_GetReqkousyouDestroyship; kclib.GetGetmemberMaterial += kclib_GetGetmemberMaterial; kclib.GetReqhenseiChange += kclib_GetReqhenseiChange; kclib.GetGetmemberSlotItem += kclib_GetGetmemberSlotItem; kclib.GetReqkousyouCreateitem += kclib_GetReqkousyouCreateitem; shipdata.CollectionChanged += shipdata_CollectionChanged; slotdata.CollectionChanged += slotdata_CollectionChanged; }
public Form1() { InitializeComponent(); Fiddler.FiddlerApplication.AfterSessionComplete += new Fiddler.SessionStateHandler(FiddlerApplication_AfterSessionComplete); Fiddler.FiddlerApplication.Startup(PROXY_PORT, Fiddler.FiddlerCoreStartupFlags.ChainToUpstreamGateway); //プロキシの設定(この場合は、ローカルのプロキシで第1引数のポート番号で通信) //FiddlerApplication.Startup(0, Fiddler.FiddlerCoreStartupFlags.RegisterAsSystemProxy); //システムのプロキシの設定全部乗っ取る URLMonInterop.SetProxyInProcess(string.Format("127.0.0.1:{0}", Fiddler.FiddlerApplication.oProxy.ListenPort), "<local>"); //oSession["x-overrideGateway"] = string.Format("localhost:{0:D}", proxy.UpstreamPort); // 上流プロキシの設定? }
/// <summary> /// Initializes FiddlerApplication /// </summary> public static void Run() { System.Diagnostics.Debug.WriteLine("Starting FiddlerCore..."); CONFIG.IgnoreServerCertErrors = false; try { //do not register as system proxy to avoid interfering with the machine proxy FiddlerApplication.Startup(8888, false, true); //assign fiddler to the current application only //SetProxyInProcess only impacts the WinINET proxy settings for the current process URLMonInterop.SetProxyInProcess("127.0.0.1:8888", null); } catch { } //assign AfterSessionComplete event handler to capture requests //AfterSessionComplete event is chosen to get all necessary data from both the request and its response FiddlerApplication.AfterSessionComplete += FiddlerAfterSessionCompleteEventHandler; }