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 ) { //Else it is the request message allready, 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 .