Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
98 lines (85 sloc) 5.41 KB
title helpviewer_keywords ms.assetid
Configuring Internet Applications
downloading Internet resources, default proxy
sending data, default proxy
receiving data, default proxy
downloading Internet resources, configuring Internet applications
protocol-specific modules
custom authentication modules
receiving data, configuring Internet applications
configuration settings [.NET Framework], Internet applications
requesting data from Internet, configuring Internet applications
requesting data from Internet, default proxy
response to Internet request, default proxy
Internet, configuring Internet applications
response to Internet request, configuring Internet applications
default proxy
network resources, default proxy
sending data, configuring Internet applications
network resources, configuring Internet applications
Internet, default proxy

Configuring Internet Applications

The <system.Net> Element (Network Settings) configuration element contains network configuration information for applications. Using the <system.Net> Element (Network Settings) element, you can set proxy servers, set connection management parameters, and include custom authentication and request modules in your application.

The <defaultProxy> Element (Network Settings) element defines the proxy server returned by the GlobalProxySelection class. Any xref:System.Net.HttpWebRequest that does not have its own xref:System.Net.HttpWebRequest.Proxy%2A property set to a specific value uses the default proxy. In addition to setting the proxy address, you can create a list of server addresses that will not use the proxy, and you can indicate that the proxy should not be used for local addresses.

It is important to note that the Microsoft Internet Explorer settings are combined with the configuration settings, with the latter taking precedence.

The following example sets the default proxy server address to http://proxyserver, indicates that the proxy should not be used for local addresses, and specifies that all requests to servers located in the domain should bypass the proxy.

                usesystemdefault = "false"  
                proxyaddress = "http://proxyserver:80"  
                bypassonlocal = "true"  
                <add address="http://[a-z]+\.contoso\.com/" />  

Use the <connectionManagement> Element (Network Settings) element to configure the number of persistent connections that can be made to a specific server or to all other servers. The following example configures the application to use two persistent connections to the server, four persistent connections to the server with the IP address, and one persistent connection to all other servers.

            <add address="" maxconnection="2" />  
            <add address="" maxconnection="4" />  
            <add address="*" maxconnection="1" />  

Custom authentication modules are configured with the <authenticationModules> Element (Network Settings) element. Custom authentication modules must implement the xref:System.Net.IAuthenticationModule interface.

The following example configures a custom authentication module.

            <add type="MyAuthModule, MyAuthModule.dll" />  

You can use the <webRequestModules> Element (Network Settings) element to configure your application to use custom protocol-specific modules to request information from Internet resources. The specified modules must implement the xref:System.Net.IWebRequestCreate interface. You can override the default HTTP, HTTPS, and file request modules by specifying your custom module in the configuration file, as in the following example.

                type = "MyHttpRequest.dll, MyHttpRequestCreator"  

See also

You can’t perform that action at this time.