Remoting Performance and Auto Web Proxy [Hoop Somuah]
The .Net Framework 2.0 has significant changes to its support for proxies including support for connection-specific proxy settings, automatic proxy configuration and the ability to automatically refreshing proxy settings whenever the active connection changes. These features can be very useful in .Net Remoting but the auto web proxy feature can also affect performance. If you do not need these settings in your client it might be useful to disable them.
There are a number of ways to disable this:
1. In Internet Explorer Open Internet Options, (either through control panel or the Internet Explorerâ„¢ tools menu), switch to the connections tab, and select LAN settings. Clear all checkboxes under automatic configuration. This will disable automatic proxy settings for the current user (note that this will not work for ASP.NET sites making outgoing web service calls because they run under a different user).
2. Imperatively disable it by setting System.Net.WebRequest.DefaultWebProxy = null;
3. In your config file bypass the proxy for your web-server. You can also disable the default proxy altogether. (See: <msdn2.microsoft.com/en-us/library/31465c77.aspx>)
The following article has some great information about the automatic configuration features in the .Net Framework msdn.microsoft.com/msdnmag/issues/05/08/AutomaticProxyDetection/default.aspx
Comments
Anonymous
March 09, 2008
the client is behind a firewall, and for some reasons, it could not set remoting with sock5? the Default Gateway, so, the client using DO has to manually support sock5. but here how currently work: domain = (Domain)RemotingServices.Connect(typeof(Domain), string.Format(ServerURL, ipAdress, port.ToString())); how to support sock5, I could not find any property to set the proxy settings. I found System.Runtime.Remoting.Services.RemotingClientProxy, but only a little documents on it. I also found something like below but not know how to associate it with my current remoting: string proxyserver = "192.168.2.1"; int proxyport = 8080; string ProxyUserName = "zs03"; string ProxyUserName = "mypass"; string ProxyDomain = "myDomain"; System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(ProxyUserName, ProxyPassword, ProxyDomain); System.Collections.Hashtable hash = new Hashtable(); hash.Add("credentials", credentials); hash.Add("proxyName", proxyserver); hash.Add("proxyPort", proxyport); HttpClientChannel ChannelHttpClient = new HttpClientChannel(hash, new BinaryClientFormatterSinkProvider()); ChannelServices.RegisterChannel(ChannelHttpClient); and I also found another code still not know how to associate it with my current remoting:: public static void SetChannelProxy( HttpChannel channel, IWebProxy proxy ) { FieldInfo clientChannelFieldInfo = typeof(HttpChannel).GetField("_clientChannel", BindingFlags.Instance | BindingFlags.NonPublic); HttpClientChannel clientChannel = (HttpClientChannel) clientChannelFieldInfo.GetValue(channel); FieldInfo proxyObjectFieldInfo = typeof(HttpClientChannel).GetField("_proxyObject", BindingFlags.Instance | BindingFlags.NonPublic); proxyObjectFieldInfo.SetValue( clientChannel, proxy ); }Anonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=dotnet-remoting-remoting-performance-and-auto-web-proxy-hoop-somuah