java.lang.Object
java.net.ProxySelector
org.miaixz.bus.http.metric.proxy.NullProxySelector
A
ProxySelector that always returns Proxy.NO_PROXY. This can be used to effectively disable proxy
usage.- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectFailed(URI uri, SocketAddress socketAddress, IOException ex) Called to indicate that a connection to a proxy has failed.Selects a list of proxies to use for a given URI.Methods inherited from class java.net.ProxySelector
getDefault, of, setDefault
-
Constructor Details
-
NullProxySelector
public NullProxySelector()
-
-
Method Details
-
select
Selects a list of proxies to use for a given URI. This implementation always returns a list containing onlyProxy.NO_PROXY.- Specified by:
selectin classProxySelector- Parameters:
uri- The URI to select a proxy for.- Returns:
- A list containing only
Proxy.NO_PROXY. - Throws:
IllegalArgumentException- if the URI is null.
-
connectFailed
Called to indicate that a connection to a proxy has failed. This implementation does nothing.- Specified by:
connectFailedin classProxySelector- Parameters:
uri- The URI that the proxy failed to connect to.socketAddress- The address of the proxy that failed.ex- The I/O exception that occurred.
-