public class Proxy extends Object
Proxy是不可变的对象。
ProxySelector
| Modifier and Type | Class and Description |
|---|---|
static class |
Proxy.Type
表示代理类型。
|
| Modifier and Type | Field and Description |
|---|---|
static Proxy |
NO_PROXY
代理设置,代表一个
DIRECT连接,基本上告诉协议处理程序不使用任何代理。
|
| Constructor and Description |
|---|
Proxy(Proxy.Type type, SocketAddress sa)
创建一个表示代理连接的条目。
|
public static final Proxy NO_PROXY
DIRECT连接,基本上告诉协议处理程序不使用任何代理。使用,例如,创建套接字绕过任何其他全球代理服务器设置(如袜子):
Socket s = new Socket(Proxy.NO_PROXY);
public Proxy(Proxy.Type type, SocketAddress sa)
使用为代表的直接连接Proxy.NO_PROXY常数。
type -代理的
Type
sa -代理的
SocketAddress
IllegalArgumentException当类型和地址是不相容的
public Proxy.Type type()
public SocketAddress address()
null如果直接连接。
SocketAddress代表代理终结点的插座
public String toString()
DIRECT。
public final boolean equals(Object obj)
true如果只有参数不
null它代表相同的代理对象。
对Proxy两实例表示相同的地址,如果两者socketaddresses和类型都是平等的。
equals 方法重写,继承类
Object
obj -比较的对象。
true如果对象是相同的;
false否则。
InetSocketAddress.equals(java.lang.Object)
public final int hashCode()
hashCode 方法重写,继承类
Object
Object.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.