Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Defines a proxy server.
<configuration>
<system.net>
<defaultProxy>
<proxy>
<proxy
autoDetect="True|False|Unspecified"
bypassonlocal="True|False|Unspecified"
proxyaddress="uriString"
scriptLocation="uriString"
usesystemdefault="True|False|Unspecified"
/>
The following sections describe attributes, child elements, and parent elements.
Attribute | Description |
---|---|
autoDetect |
Specifies whether the proxy is automatically detected. The default value is Unspecified . |
bypassonlocal |
Specifies whether the proxy is bypassed for local resources. Local resources include the local server (http://localhost , http://loopback , or http://127.0.0.1 ) and a URI without a period (http://webserver ). The default value is Unspecified . |
proxyaddress |
Specifies the proxy URI to use. |
scriptLocation |
Specifies the location of the configuration script. Do not use the bypassonlocal attribute with this attribute. |
usesystemdefault |
Specifies whether to use system proxy settings. If set to True , subsequent attributes will override system proxy settings. The default value is Unspecified . |
None.
Element | Description |
---|---|
defaultProxy | Configures the Hypertext Transfer Protocol (HTTP) proxy server. |
The proxy
element defines a proxy server for an application. If this element is missing from the configuration file, then .NET Framework will use the system proxy settings.
The value for the proxyaddress
attribute should be a well-formed Uniform Resource Indicator (URI).
The scriptLocation
attribute refers to the automatic detection of proxy configuration scripts. The WebProxy class will attempt to locate a configuration script (usually named Wpad.dat) when the Use automatic configuration script option is selected for the connection in Internet properties. If bypassonlocal
is set to any value, scriptLocation
is ignored.
An exception is thrown if the proxyaddress
attribute specifies an invalid default proxy. The InnerException property on the exception should have more information about the root cause of the error.
This element can be used in the application configuration file or the machine configuration file (Machine.config).
The following example uses the defaults from the system proxy, specifies the proxy address, and bypasses the proxy for local access.
<configuration>
<system.net>
<defaultProxy>
<proxy
usesystemdefault="True"
proxyaddress="http://192.168.1.10:3128"
bypassonlocal="True"
/>
</defaultProxy>
</system.net>
</configuration>
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now