Fiddler为FiddlerCore的UI版本,Fiddler4之后的版本是付费的,仅仅为了扒资源又去下载个付费版太不值了,FiddlerCore4.0这个版本的坑还是挺多的,本人也是从踩坑又爬坑又踩坑......
废话不多说,上代码
using System;
using Fiddler;
using BCCertMaker;
using System.Windows.Forms;
using System.Collections.Generic;
namespace SGM_GATEWAY
{
class FiddlerUtil
{
//代理端口
private static int proxyPort = 9937;
//启动端口
private static int startPort = 9936;
private static bool isIgnoreCertError = false;
// 代理
private static Proxy proxy;
private static string proxyHost = "localhost";
private static bool isStart = false;
public static Login login;
public static bool start(int type,FormMain formMain)
{
TYPE = type;
try
{
if (FiddlerApplication.IsStarted())
{
close(formMain,false);
}
// 设置证书
if (!Fiddler.