- HTTP proxy concepts
The .NET runtime does not, however, support automatic proxy discovery scripts. If Internet Explorer uses the automatic configuration options to determine the HTTP proxy settings, you can manually configure the global HTTP proxy settings in the Machine.config file. Likewise, if you are using the .NET runtime to access an XML Web service in a situation in which a user profile is not loaded (for example, if you call an XML Web service from an ASP.NET page), you must configure the computer settings in the Machine.config file.
To configure the HTTP proxy settings for desktop and ASP.NET applications, follow these steps:
- Edit the Machine.config file. For the .NET Framework, the default location for this file is C:\WINNT\Microsoft .NET\Framework\v1.0.2914\CONFIG\machine.config.
- Locate the \configuration\system.net\defaultProxy element in the XML.
- Change the child <proxy> element to the following, where http://myproxyserver indicates your HTTP proxy server: The bypassonlocal attribute indicates that requests to hosts whose names contain a period (.) should not be sent through the proxy.
- If other addresses need to bypass the proxy server, you can add them by creating a <bypasslist> element as a child of the <defaultProxy> element. The <bypasslist> syntax should resemble the following: This syntax avoids sending any requests to localdomain.com and localdomain2.com through the HTTP proxy. The address attribute is actually a string that contains a regular expression. For more information on the syntax of regular expressions, see the information on System.Text.RegularExpresions in the .NET runtime documentation.
<add address="localdomain.com|localdomain2.com" />
- Save the changes to Machine.config and restart the application.
Article ID: 307220 - Last Review: Jul 31, 2003 - Revision: 1