|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--socks.server.ServerAuthenticatorNone
An implementation of ServerAuthenticator, which does not do any authentication.
Warning!!
Should not be
used on machines which are not behind the firewall.
It is only provided to make implementing other authentication schemes
easier.
For Example:
class MyAuth extends socks.server.ServerAuthenticator{
...
public ServerAuthenticator startSession(java.net.Socket s){
if(!checkHost(s.getInetAddress()) return null;
return super.startSession(s);
}
boolean checkHost(java.net.Inetaddress addr){
boolean allow;
//Do it somehow
return allow;
}
}
Constructor Summary | |
ServerAuthenticatorNone()
Creates new instance of the ServerAuthenticatorNone. |
|
ServerAuthenticatorNone(java.io.InputStream in,
java.io.OutputStream out)
Constructs new ServerAuthenticatorNone object suitable for returning from the startSession function. |
Method Summary | |
boolean |
checkRequest(java.net.DatagramPacket dp,
boolean out)
Allways returns true. |
boolean |
checkRequest(ProxyMessage msg)
Allways returns true. |
void |
endSession()
Does nothing. |
java.io.InputStream |
getInputStream()
Get input stream. |
java.io.OutputStream |
getOutputStream()
Get output stream. |
UDPEncapsulation |
getUdpEncapsulation()
Allways returns null. |
static boolean |
selectSocks5Authentication(java.io.InputStream in,
java.io.OutputStream out,
int methodId)
Convinience routine for selecting SOCKSv5 authentication. |
ServerAuthenticator |
startSession(java.net.Socket s)
Grants access to everyone.Removes authentication related bytes from the stream, when a SOCKS5 connection is being made, selects an authentication NONE. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ServerAuthenticatorNone()
public ServerAuthenticatorNone(java.io.InputStream in, java.io.OutputStream out)
in
- Input stream to return from getInputStream method.out
- Output stream to return from getOutputStream method.Method Detail |
public ServerAuthenticator startSession(java.net.Socket s) throws java.io.IOException
s
- Accepted Socket.public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public UDPEncapsulation getUdpEncapsulation()
public boolean checkRequest(ProxyMessage msg)
msg
- Request message.public boolean checkRequest(java.net.DatagramPacket dp, boolean out)
out
- If true the datagram is being send out(from the client),
otherwise it is an incoming datagram.public void endSession()
public static boolean selectSocks5Authentication(java.io.InputStream in, java.io.OutputStream out, int methodId) throws java.io.IOException
This method reads in authentication methods that client supports, checks wether it supports given method. If it does, the notification method is written back to client, that this method have been chosen for authentication. If given method was not found, authentication failure message is send to client ([5,FF]).
in
- Input stream, version byte should be removed from the stream
before calling this method.out
- Output stream.methodId
- Method which should be selected.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |