Exemplo n.º 1
0
 public WinHTTPAutoProxy(bool bAutoDiscover, string sAutoConfigUrl)
 {
     this._bUseAutoDiscovery = bAutoDiscover;
     if (!string.IsNullOrEmpty(sAutoConfigUrl))
     {
         this._sPACScriptLocation = sAutoConfigUrl;
     }
     this._oAPO     = GetAutoProxyOptionsStruct(this._sPACScriptLocation, this._bUseAutoDiscovery);
     this._hSession = WinHTTPNative.WinHttpOpen("Fiddler", 1, IntPtr.Zero, IntPtr.Zero, 0);
 }
Exemplo n.º 2
0
 public WinHTTPAutoProxy(bool bAutoDiscover, string sAutoConfigUrl)
 {
     this._bUseAutoDiscovery = bAutoDiscover;
     if (!string.IsNullOrEmpty(sAutoConfigUrl))
     {
         if (sAutoConfigUrl.OICStartsWith("file:") || sAutoConfigUrl.StartsWith("\\\\") || (sAutoConfigUrl.Length > 2 && sAutoConfigUrl[1] == ':'))
         {
             Proxy.sUpstreamPACScript = WinHTTPAutoProxy.GetPACFileText(sAutoConfigUrl);
             if (!string.IsNullOrEmpty(Proxy.sUpstreamPACScript))
             {
                 FiddlerApplication.Log.LogFormat("!WARNING: System proxy was configured to use a file-protocol sourced script ({0}). Proxy scripts delivered by the file protocol are not supported by many clients. Please see http://blogs.msdn.com/b/ieinternals/archive/2013/10/11/web-proxy-configuration-and-ie11-changes.aspx for more information.", new object[]
                 {
                     sAutoConfigUrl
                 });
                 sAutoConfigUrl = "http://" + CONFIG.sFiddlerListenHostPort + "/UpstreamProxy.pac";
             }
         }
         this._sPACScriptLocation = sAutoConfigUrl;
     }
     this._oAPO     = WinHTTPAutoProxy.GetAutoProxyOptionsStruct(this._sPACScriptLocation, this._bUseAutoDiscovery);
     this._hSession = WinHTTPNative.WinHttpOpen("Fiddler", 1, IntPtr.Zero, IntPtr.Zero, 0);
 }