public abstract class ProxyMessage
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
command
Request/response code as an int
|
java.lang.String |
host
Host as string.
|
java.net.InetAddress |
ip
Host as an IP address
|
int |
port
Port field of the request/response
|
java.lang.String |
user
User field for SOCKS4 request messages
|
int |
version
SOCKS version, or version of the response for SOCKS4
|
| Modifier and Type | Method and Description |
|---|---|
java.net.InetAddress |
getInetAddress()
Get the Address field of this message as InetAddress object.
|
abstract void |
read(java.io.InputStream in)
Initialises Message from the stream.
|
abstract void |
read(java.io.InputStream in,
boolean client_mode)
Initialises Message from the stream.
|
java.lang.String |
toString()
Get string representaion of this message.
|
abstract void |
write(java.io.OutputStream out)
Writes the message to the stream.
|
public java.net.InetAddress ip
public int version
public int port
public int command
public java.lang.String host
public java.lang.String user
public abstract void read(java.io.InputStream in)
throws SocksException,
java.io.IOException
in - Input stream to read response from.SocksException - If server response code is not SOCKS_SUCCESS(0), or
if any error with protocol occurs.java.io.IOException - If any error happens with I/O.public abstract void read(java.io.InputStream in,
boolean client_mode)
throws SocksException,
java.io.IOException
in - Input stream to read response from.clinetMode - If true read server response, else read client request.SocksException - If server response code is not SOCKS_SUCCESS(0) and
reading in client mode, or if any error with protocol occurs.java.io.IOException - If any error happens with I/O.public abstract void write(java.io.OutputStream out)
throws SocksException,
java.io.IOException
out - Output stream to which message should be written.SocksExceptionjava.io.IOExceptionpublic java.net.InetAddress getInetAddress()
throws java.net.UnknownHostException
java.net.UnknownHostExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2012. All Rights Reserved.