public abstract class ProxyMessage extends Object
Modifier and Type | Field and Description |
---|---|
int |
command
Request/response code as an int
|
String |
host
Host as string.
|
InetAddress |
ip
Host as an IP address
|
int |
port
Port field of the request/response
|
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 |
---|---|
InetAddress |
getInetAddress()
Get the Address field of this message as InetAddress object.
|
abstract void |
read(InputStream in)
Initialises Message from the stream.
|
abstract void |
read(InputStream in,
boolean client_mode)
Initialises Message from the stream.
|
String |
toString()
Get string representaion of this message.
|
abstract void |
write(OutputStream out)
Writes the message to the stream.
|
public InetAddress ip
public int version
public int port
public int command
public String host
public String user
public abstract void read(InputStream in) throws SocksException, 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.IOException
- If any error happens with I/O.public abstract void read(InputStream in, boolean client_mode) throws SocksException, 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.IOException
- If any error happens with I/O.public abstract void write(OutputStream out) throws SocksException, IOException
out
- Output stream to which message should be written.SocksException
IOException
public InetAddress getInetAddress() throws UnknownHostException
UnknownHostException
Copyright © 2024. All rights reserved.