|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsocks.ProxyServer
public class ProxyServer
SOCKS4 and SOCKS5 proxy, handles both protocols simultaniously. Implements all SOCKS commands, including UDP relaying.
In order to use it you will need to implement ServerAuthenticator interface. There is an implementation of this interface which does no authentication ServerAuthenticatorNone, but it is very dangerous to use, as it will give access to your local network to anybody in the world. One should never use this authentication scheme unless one have pretty good reason to do so. There is a couple of other authentication schemes in socks.server package.
ServerAuthenticator
Field Summary | |
---|---|
static boolean |
startFuzzing
|
static boolean |
startRecording
|
Constructor Summary | |
---|---|
ProxyServer(ServerAuthenticator auth)
Creates a proxy server with given Authentication scheme. |
Method Summary | |
---|---|
static Proxy |
getProxy()
Get proxy. |
void |
run()
|
static void |
setAcceptTimeout(int timeout)
Sets the timeout for BIND command, how long the server should wait for the incoming connection. Zero timeout implies infinity. Default timeout is 3 minutes. |
static void |
setDatagramSize(int size)
Sets the size of the datagrams used in the UDPRelayServer. Default size is 64K, a bit more than maximum possible size of the datagram. |
static void |
setIddleTimeout(int timeout)
Sets the timeout for connections, how long shoud server wait for data to arrive before dropping the connection. Zero timeout implies infinity. Default timeout is 3 minutes. |
static void |
setLog(java.io.OutputStream out)
Set the logging stream. |
void |
setPort(int port)
Sets the port number |
static void |
setProxy(Proxy p)
Set proxy. |
static void |
setUDPTimeout(int timeout)
Sets the timeout for UDPRelay server. Zero timeout implies infinity. Default timeout is 3 minutes. |
void |
start(int port)
Start the Proxy server at given port. This methods blocks. |
void |
start(int port,
int backlog,
java.net.InetAddress localIP)
Create a server with the specified port, listen backlog, and local IP address to bind to. |
void |
startFuzzer()
Start the fuzzing engine |
boolean |
startRecording()
Sets the flag to start recording the input/output traffic |
void |
stop()
Stop server operation.It would be wise to interrupt thread running the server afterwards. |
void |
stopFuzzer()
Stops the fuzzing engine |
boolean |
stopRecording()
Sets the flag to stop recording the input/output traffic |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean startRecording
public static boolean startFuzzing
Constructor Detail |
---|
public ProxyServer(ServerAuthenticator auth)
auth
- Authentication scheme to be used.Method Detail |
---|
public static void setLog(java.io.OutputStream out)
public static void setProxy(Proxy p)
Allows Proxy chaining so that one Proxy server is connected to another and so on. If proxy supports SOCKSv4, then only some SOCKSv5 requests can be handled, UDP would not work, however CONNECT and BIND will be translated.
p
- Proxy which should be used to handle user requests.public static Proxy getProxy()
public static void setIddleTimeout(int timeout)
public static void setAcceptTimeout(int timeout)
public static void setUDPTimeout(int timeout)
public static void setDatagramSize(int size)
public void start(int port)
public void setPort(int port)
public void start(int port, int backlog, java.net.InetAddress localIP)
java.io.IOException
public void stop()
public void run()
run
in interface java.lang.Runnable
public boolean startRecording()
public boolean stopRecording()
public void startFuzzer()
public void stopFuzzer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |