public class ProxyConnection extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
PROXY_TYPE_HTTP
HTTP or HTTPS proxy.
|
static int |
PROXY_TYPE_SOCKS4
SOCKS4 proxy.
|
static int |
PROXY_TYPE_SOCKS5
SOCKS5 proxy.
|
| Constructor and Description |
|---|
ProxyConnection()
Creates a new proxy connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect(String host,
int port)
Connect to the proxy.
|
String |
getPassword()
Get the value of password.
|
String |
getProxyHost()
Get the value of proxyHost.
|
int |
getProxyPort()
Get the value of proxyPort.
|
Socket |
getSocket()
Get the value of socket.
|
int |
getType()
Get the value of type.
|
URLConnection |
getURLConnection()
Get the value of uc.
|
String |
getUser()
Get the value of user.
|
void |
setPassword(String password)
Set the value of password.
|
void |
setProxyHost(String proxyHost)
Set the value of proxyHost.
|
void |
setProxyPort(int proxyPort)
Set the vlaue of proxyPort.
|
void |
setType(int type)
Set the value of type.
|
void |
setUseJavaInternal(boolean useJavaInternal)
Set the value of useJavaInternal.
|
void |
setUser(String user)
Set the value of user.
|
boolean |
useJavaInternal()
Get the value of useJavaInternal.
|
public static final int PROXY_TYPE_SOCKS4
public static final int PROXY_TYPE_SOCKS5
public static final int PROXY_TYPE_HTTP
public void connect(String host, int port) throws IOException
host - the proxy hostport - the proxy portIOException - if an error occurspublic int getType()
public void setType(int type)
type - Value to assign to typepublic String getUser()
public void setUser(String user)
user - Value to assign to user.public String getPassword()
public void setPassword(String password)
password - Value to assign to password.public boolean useJavaInternal()
public void setUseJavaInternal(boolean useJavaInternal)
useJavaInternal - Value to assign to useJavaInternal.public String getProxyHost()
public void setProxyHost(String proxyHost)
proxyHost - Value to assign to proxyHost.public int getProxyPort()
public void setProxyPort(int proxyPort)
proxyPort - Value to assign to proxyPort.public Socket getSocket()
public URLConnection getURLConnection()