Gets or sets the global HTTP proxy.
public:
static property System::Net::IWebProxy ^ DefaultProxy { System::Net::IWebProxy ^ get(); void set(System::Net::IWebProxy ^ value); };
public static System.Net.IWebProxy DefaultProxy { get; set; }
static member DefaultProxy : System.Net.IWebProxy with get, set
Public Shared Property DefaultProxy As IWebProxy
Property Value
A proxy used by every HTTP request.
ExceptionsThe value passed cannot be null
.
This static property determines the default proxy that all HttpClient instances use if no proxy is set explicitly in the HttpMessageHandler passed through its constructor.
The default instance returned by this property will initialize following a different set of rules depending on your platform:
For Windows: Reads proxy configuration from environment variables or, if those are not defined, from the user's proxy settings.
For macOS: Reads proxy configuration from environment variables or, if those are not defined, from the system's proxy settings.
For Linux: Reads proxy configuration from environment variables or, in case those are not defined, this property initializes a non-configured instance that bypasses all addresses.
The environment variables used for DefaultProxy
initialization on Windows and Unix-based platforms are:
NO_PROXY=.example.com
(with leading dot) will match www.example.com
, but will not match example.com
. NO_PROXY=example.com
(without leading dot) will not match www.example.com
. This behavior might be revisited in the future to match other ecosystems better.On systems where environment variables are case-sensitive, the variable names may be all lowercase or all uppercase. The lowercase names are checked first.
The proxy server may be a hostname or IP address, optionally followed by a colon and port number, or it may be an http
, https
, socks4
, socks4a
, or socks5
URL. The URL cannot include any text after the hostname, IP, or port. If a scheme isn't specified, http
is assumed. The URL may optionally include a username and password for proxy authentication, but the password is ignored when using socks4
or socks4a
as the protocols have no support for password authentication.
http
: http://[username:password@]hostname[:port]
https
: https://[username:password@]hostname[:port]
socks4
: socks4://[username@]hostname[:port]
socks4a
: socks4a://[username@]hostname[:port]
socks5
: socks5://[username:password@]hostname[:port]
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4