public class ProxyInfo extends Object
| Constructor and Description |
|---|
ProxyInfo(ProxySelector proxySelector,
PasswordAuthentication auth)
构造
|
ProxyInfo(String host,
int port)
构造
|
| Modifier and Type | Method and Description |
|---|---|
PasswordAuthentication |
getAuth()
获取代理验证信息
|
String |
getAuthHost()
获取代理验证主机
|
int |
getAuthPort()
获取代理验证端口
|
ProxySelector |
getProxySelector()
获取代理选择器
|
Proxy |
selectFirst(URI uri)
获取第一个代理
如果代理选择器为空,返回null |
ProxyInfo |
setAuth(PasswordAuthentication auth)
设置代理验证信息
|
ProxyInfo |
setAuth(String user,
char[] pass)
设置代理验证信息
|
void |
setAuthHost(String authHost)
设置代理验证主机
|
void |
setAuthPort(int authPort)
设置代理验证端口
|
ProxyInfo |
setProxySelector(ProxySelector proxySelector)
设置代理选择器
|
public ProxyInfo(String host, int port)
host - 代理地址port - 代理端口public ProxyInfo(ProxySelector proxySelector, PasswordAuthentication auth)
proxySelector - ProxySelectorauth - 用户名和密码public String getAuthHost()
public void setAuthHost(String authHost)
authHost - 代理验证主机public int getAuthPort()
public void setAuthPort(int authPort)
authPort - 代理验证端口public ProxySelector getProxySelector()
ProxySelectorpublic ProxyInfo setProxySelector(ProxySelector proxySelector)
proxySelector - ProxySelectorpublic ProxyInfo setAuth(String user, char[] pass)
user - 用户名pass - 密码public ProxyInfo setAuth(PasswordAuthentication auth)
auth - PasswordAuthenticationpublic PasswordAuthentication getAuth()
PasswordAuthenticationCopyright © 2025. All rights reserved.