Example #1
0
 public WinINETConnectoids()
 {
     string[] connectionNames = RASInfo.GetConnectionNames();
     string[] array           = connectionNames;
     for (int i = 0; i < array.Length; i++)
     {
         string text = array[i];
         if (CONFIG.bDebugSpew)
         {
             FiddlerApplication.DebugSpew("Collecting information for Connectoid '{0}'", new object[]
             {
                 text
             });
         }
         if (!this._oConnectoids.ContainsKey(text))
         {
             try
             {
                 WinINETProxyInfo winINETProxyInfo = WinINETProxyInfo.CreateFromNamedConnection(text);
                 if (winINETProxyInfo == null)
                 {
                     FiddlerApplication.Log.LogFormat("!WARNING: Failed to get proxy information for Connection '{0}'.", new object[]
                     {
                         text
                     });
                 }
                 else
                 {
                     WinINETConnectoid winINETConnectoid = new WinINETConnectoid();
                     winINETConnectoid.sConnectionName = text;
                     if (!string.IsNullOrEmpty(winINETProxyInfo.sHttpProxy) && winINETProxyInfo.sHttpProxy.Contains(CONFIG.sFiddlerListenHostPort))
                     {
                         FiddlerApplication.Log.LogString("When connecting, upstream proxy settings were already pointed at Fiddler. Clearing upstream proxy.");
                         winINETProxyInfo.sHttpProxy        = (winINETProxyInfo.sHttpsProxy = (winINETProxyInfo.sFtpProxy = null));
                         winINETProxyInfo.bUseManualProxies = false;
                         winINETProxyInfo.bAllowDirect      = true;
                     }
                     if (!string.IsNullOrEmpty(winINETProxyInfo.sPACScriptLocation) && (winINETProxyInfo.sPACScriptLocation == "file://" + CONFIG.GetPath("Pac") || winINETProxyInfo.sPACScriptLocation == "http://" + CONFIG.sFiddlerListenHostPort + "/proxy.pac"))
                     {
                         FiddlerApplication.Log.LogString("When connecting, upstream proxy script was already pointed at Fiddler. Clearing upstream proxy.");
                         winINETProxyInfo.sPACScriptLocation = null;
                     }
                     winINETConnectoid.oOriginalProxyInfo = winINETProxyInfo;
                     this._oConnectoids.Add(text, winINETConnectoid);
                 }
             }
             catch (Exception eX)
             {
                 FiddlerApplication.Log.LogFormat("!WARNING: Failed to get proxy information for Connection '{0}' due to {1}", new object[]
                 {
                     text,
                     Utilities.DescribeException(eX)
                 });
             }
         }
     }
 }
 public WinINETConnectoids()
 {
     foreach (string str in RASInfo.GetConnectionNames())
     {
         if (CONFIG.bDebugSpew)
         {
             FiddlerApplication.DebugSpew("Collecting information for Connectoid '{0}'", new object[] { str });
         }
         if (!this._oConnectoids.ContainsKey(str))
         {
             try
             {
                 WinINETProxyInfo info = WinINETProxyInfo.CreateFromNamedConnection(str);
                 if (info == null)
                 {
                     FiddlerApplication.Log.LogFormat("!WARNING: Failed to get proxy information for Connection '{0}'.", new object[] { str });
                 }
                 else
                 {
                     WinINETConnectoid connectoid = new WinINETConnectoid {
                         sConnectionName = str
                     };
                     if (!string.IsNullOrEmpty(info.sHttpProxy) && info.sHttpProxy.Contains(CONFIG.sFiddlerListenHostPort))
                     {
                         FiddlerApplication.Log.LogString("When connecting, upstream proxy settings were already pointed at Fiddler. Clearing upstream proxy.");
                         info.sHttpProxy = info.sHttpsProxy = (string) (info.sFtpProxy = null);
                         info.bUseManualProxies = false;
                         info.bAllowDirect = true;
                     }
                     connectoid.oOriginalProxyInfo = info;
                     this._oConnectoids.Add(str, connectoid);
                 }
             }
             catch (Exception exception)
             {
                 FiddlerApplication.Log.LogFormat("!WARNING: Failed to get proxy information for Connection '{0}' due to {1}", new object[] { str, Utilities.DescribeException(exception) });
             }
         }
     }
 }
 public WinINETConnectoids()
 {
     foreach (string str in RASInfo.GetConnectionNames())
     {
         if (!this._oConnectoids.ContainsKey(str))
         {
             WinINETProxyInfo info = WinINETProxyInfo.CreateFromNamedConnection(str);
             if (info != null)
             {
                 WinINETConnectoid connectoid = new WinINETConnectoid {
                     sConnectionName = str
                 };
                 if ((info.sHttpProxy != null) && info.sHttpProxy.Contains(CONFIG.sFiddlerListenHostPort))
                 {
                     info.sHttpProxy        = info.sHttpsProxy = (string)(info.sFtpProxy = null);
                     info.bUseManualProxies = false;
                     info.bAllowDirect      = true;
                 }
                 connectoid.oOriginalProxyInfo = info;
                 this._oConnectoids.Add(str, connectoid);
             }
         }
     }
 }