public ServerAuthenticator startSession(Socket s) throws IOException {
  PushbackInputStream in=new PushbackInputStream(s.getInputStream());
  OutputStream out=s.getOutputStream();
  int version=in.read();
  if (version == 5) {
    if (!selectSocks5Authentication(in,out,0))     return null;
  }
 else   if (version == 4) {
    in.unread(version);
  }
 else   return null;
  return new ServerAuthenticatorNone(in,out);
}

public ServerAuthenticator startSession ( Socket s ) throws IOException { PushbackInputStream in = new PushbackInputStream ( s . getInputStream ( ) ) ; OutputStream out = s . getOutputStream ( ) ; int version = in . read ( ) ; if ( version == 5 ) { if ( ! selectSocks5Authentication ( in , out , 0 ) ) return null ; } else if ( version == 4 ) { in . unread ( version ) ; } else return null ; return new ServerAuthenticatorNone ( in , out ) ; }
grants access to everyone . removes authentication related bytes from the stream , when a socks5 connection is being made , selects an authentication none .
