Exemplo n.º 1
0
 /// <summary>
 /// Initialize the web service proxy stub.
 /// </summary>
 /// <param name="request">The client proxy to initialize</param>
 /// <param name="domainID">The identifier for the domain.</param>
 public void InitializeWebClient(HttpWebClientProtocol request, string domainID)
 {
     request.UserAgent       = userAgent;
     request.Credentials     = credentials;
     request.CookieContainer = cookieHash[domainID] as CookieContainer;
     request.Proxy           = ProxyState.GetProxyState(new Uri(request.Url));
     request.PreAuthenticate = true;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initialize the HttpWebRequest.
 /// </summary>
 /// <param name="request">The request to initialize.</param>
 /// <param name="domainID">The identifier for the domain.</param>
 public void InitializeWebRequest(HttpWebRequest request, string domainID)
 {
     //request.KeepAlive = false;
     request.UserAgent       = userAgent;
     request.Credentials     = credentials;
     request.CookieContainer = cookieHash[domainID] as CookieContainer;
     request.Proxy           = ProxyState.GetProxyState(request.RequestUri);
     request.PreAuthenticate = true;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Adds a ProxyState object for the specified server address.
        /// </summary>
        /// <param name="server">The simias server address.</param>
        /// <param name="proxy">The proxy server address.</param>
        /// <param name="proxyUser">The user name for proxy authentication.</param>
        /// <param name="proxyPassword">The password for proxy authentication.</param>
        public static ProxyState AddProxyState(Uri server, Uri proxy, string proxyUser, string proxyPassword)
        {
            lock ( proxyHash )
            {
                string     key = ProxyKey(server);
                ProxyState ps  = proxyHash[key] as ProxyState;
                if (ps != null)
                {
                    ps.InitializeWebProxy(proxy, proxyUser, proxyPassword);
                }
                else
                {
                    ps             = new ProxyState(proxy, proxyUser, proxyPassword);
                    proxyHash[key] = ps;
                }

                return(ps);
            }
        }