internal static WebProxyData GetWebProxyData(string connectoid)
        {
            GlobalLog.Print("ProxyRegBlob::GetWebProxyData() connectoid:" + ValidationHelper.ToString(connectoid));
            WebProxyData webProxyData   = new WebProxyData();
            Hashtable    proxyHashTable = null;
            Uri          address        = null;

            string proxyAddressString = ReadConfigString("ProxyUri");
            string proxyBypassString  = ReadConfigString("ProxyBypass");

            try {
                address = ParseProxyUri(proxyAddressString, true);
                if (address == null)
                {
                    proxyHashTable = ParseProtocolProxies(proxyAddressString);
                }
                if ((address != null || proxyHashTable != null) && proxyBypassString != null)
                {
                    webProxyData.bypassList = ParseBypassList(proxyBypassString, out webProxyData.bypassOnLocal);
                }
                // success if we reach here
            }
            catch {
            }

            if (proxyHashTable != null)
            {
                address = proxyHashTable["http"] as Uri;
            }
            webProxyData.proxyAddress = address;

            return(webProxyData);
        }
        internal void UnsafeUpdateFromRegistry()
        {
            this._UseRegistry = true;
            this.ScriptEngine = new AutoWebProxyScriptEngine(this, true);
            WebProxyData webProxyData = this.ScriptEngine.GetWebProxyData();

            this.Update(webProxyData);
        }
Exemple #3
0
        internal void UnsafeUpdateFromRegistry()
        {
            GlobalLog.Assert(!_UseRegistry, "WebProxy#{0}::UnsafeUpdateFromRegistry()|_UseRegistry ScriptEngine#{1}", ValidationHelper.HashString(this), ValidationHelper.HashString(m_ScriptEngine));
            _UseRegistry = true;
#if !FEATURE_PAL || !MOBILE
            ScriptEngine = new AutoWebProxyScriptEngine(this, true);
            WebProxyData webProxyData = ScriptEngine.GetWebProxyData();

            Update(webProxyData);
#endif
        }
Exemple #4
0
        internal void Update(WebProxyData webProxyData)
        {
            // update needs to happen atomically
            lock (this) {
                _BypassOnLocal = webProxyData.bypassOnLocal;
                _ProxyAddress  = webProxyData.proxyAddress;
                _BypassList    = webProxyData.bypassList;

                ScriptEngine.AutomaticallyDetectSettings  = m_EnableAutoproxy && webProxyData.automaticallyDetectSettings;
                ScriptEngine.AutomaticConfigurationScript = m_EnableAutoproxy ? webProxyData.scriptLocation : null;
            }
        }
 internal void Update(WebProxyData webProxyData)
 {
     lock (this)
     {
         this._BypassOnLocal      = webProxyData.bypassOnLocal;
         this._ProxyAddress       = webProxyData.proxyAddress;
         this._ProxyHostAddresses = webProxyData.proxyHostAddresses;
         this._BypassList         = webProxyData.bypassList;
         this.ScriptEngine.AutomaticallyDetectSettings  = this.m_EnableAutoproxy && webProxyData.automaticallyDetectSettings;
         this.ScriptEngine.AutomaticConfigurationScript = this.m_EnableAutoproxy ? webProxyData.scriptLocation : null;
     }
 }
Exemple #6
0
        internal void Update(WebProxyData webProxyData)
        {
#if TRAVE
            GlobalLog.Print("WebProxy#" + ValidationHelper.HashString(this) + "::Update() Before " + DumpIWebProxy(this));
#endif
            // update needs to happen atomically
            lock (this) {
                _BypassOnLocal      = webProxyData.bypassOnLocal;
                _ProxyAddress       = webProxyData.proxyAddress;
                _ProxyHostAddresses = webProxyData.proxyHostAddresses;
                _BypassList         = webProxyData.bypassList;

                ScriptEngine.AutomaticallyDetectSettings  = m_EnableAutoproxy && webProxyData.automaticallyDetectSettings;
                ScriptEngine.AutomaticConfigurationScript = m_EnableAutoproxy ? webProxyData.scriptLocation : null;
            }
#if TRAVE
            GlobalLog.Print("WebProxy#" + ValidationHelper.HashString(this) + "::Update() After " + DumpIWebProxy(this));
#endif
        }
 internal void Update(WebProxyData webProxyData)
 {
     lock (this)
     {
         this._BypassOnLocal = webProxyData.bypassOnLocal;
         this._ProxyAddress = webProxyData.proxyAddress;
         this._ProxyHostAddresses = webProxyData.proxyHostAddresses;
         this._BypassList = webProxyData.bypassList;
         this.ScriptEngine.AutomaticallyDetectSettings = this.m_EnableAutoproxy && webProxyData.automaticallyDetectSettings;
         this.ScriptEngine.AutomaticConfigurationScript = this.m_EnableAutoproxy ? webProxyData.scriptLocation : null;
     }
 }
 public WebProxyData Build()
 {
     m_Result = new WebProxyData();
     BuildInternal();
     return m_Result;
 }
Exemple #9
0
        internal void Update(WebProxyData webProxyData) {
#if TRAVE
            GlobalLog.Print("WebProxy#" + ValidationHelper.HashString(this) + "::Update() Before " + DumpIWebProxy(this));
#endif
            // update needs to happen atomically
            lock (this) {
                _BypassOnLocal = webProxyData.bypassOnLocal;
                _ProxyAddress = webProxyData.proxyAddress;
                _ProxyHostAddresses = webProxyData.proxyHostAddresses;
                _BypassList = webProxyData.bypassList;

                ScriptEngine.AutomaticallyDetectSettings = m_EnableAutoproxy && webProxyData.automaticallyDetectSettings;
                ScriptEngine.AutomaticConfigurationScript = m_EnableAutoproxy ? webProxyData.scriptLocation : null;
            }
#if TRAVE
            GlobalLog.Print("WebProxy#" + ValidationHelper.HashString(this) + "::Update() After " + DumpIWebProxy(this));
#endif
        }
Exemple #10
0
 public WebProxyData Build()
 {
     this.m_Result = new WebProxyData();
     this.BuildInternal();
     return(this.m_Result);
 }
        internal static WebProxyData GetWebProxyData(string connectoid)
        {
            GlobalLog.Print("ProxyRegBlob::GetWebProxyData() connectoid:" + ValidationHelper.ToString(connectoid));
            WebProxyData webProxyData = new WebProxyData();
            Hashtable proxyHashTable = null;
            Uri address = null;

            string proxyAddressString = ReadConfigString("ProxyUri");
            string proxyBypassString = ReadConfigString("ProxyBypass");
            try {
                address = ParseProxyUri(proxyAddressString, true);
                if ( address == null ) {
                    proxyHashTable = ParseProtocolProxies(proxyAddressString);
                }
                if ((address != null || proxyHashTable != null) && proxyBypassString != null ) {
                    webProxyData.bypassList = ParseBypassList(proxyBypassString, out webProxyData.bypassOnLocal);
                }
                // success if we reach here
            }
            catch {
            }

            if (proxyHashTable!=null) {
                address = proxyHashTable["http"] as Uri;
            }
            webProxyData.proxyAddress = address;

            return webProxyData;
        }
 public WebProxyData Build()
 {
     this.m_Result = new WebProxyData();
     this.BuildInternal();
     return this.m_Result;
 }
 public WebProxyData Build()
 {
     m_Result = new WebProxyData();
     BuildInternal();
     return(m_Result);
 }
        internal void Update(WebProxyData webProxyData) {
            // update needs to happen atomically
            lock (this) {
                _BypassOnLocal = webProxyData.bypassOnLocal;
                _ProxyAddress = webProxyData.proxyAddress;
                _BypassList = webProxyData.bypassList;

                ScriptEngine.AutomaticallyDetectSettings = m_EnableAutoproxy && webProxyData.automaticallyDetectSettings;
                ScriptEngine.AutomaticConfigurationScript = m_EnableAutoproxy ? webProxyData.scriptLocation : null;
            }
        }