comparison src/net/sourceforge/jsocks/Authentication.java @ 349:205ee2873330

update jsocks to 2011-03-19
author Carl Byington <carl@five-ten-sg.com>
date Fri, 01 Aug 2014 11:23:10 -0700
parents 0ce5cc452d02
children
comparison
equal deleted inserted replaced
348:29076621bab0 349:205ee2873330
2 2
3 /** 3 /**
4 The Authentication interface provides for performing method specific 4 The Authentication interface provides for performing method specific
5 authentication for SOCKS5 connections. 5 authentication for SOCKS5 connections.
6 */ 6 */
7 public interface Authentication { 7 public interface Authentication{
8 /** 8 /**
9 This method is called when SOCKS5 server have selected a particular 9 This method is called when SOCKS5 server have selected a particular
10 authentication method, for whch an implementaion have been registered. 10 authentication method, for whch an implementaion have been registered.
11 11
12 <p> 12 <p>
13 This method should return an array {inputstream,outputstream 13 This method should return an array {inputstream,outputstream
14 [,UDPEncapsulation]}. The reason for that is that SOCKS5 protocol 14 [,UDPEncapsulation]}. The reason for that is that SOCKS5 protocol
15 allows to have method specific encapsulation of data on the socket for 15 allows to have method specific encapsulation of data on the socket for
16 purposes of integrity or security. And this encapsulation should be 16 purposes of integrity or security. And this encapsulation should be
17 performed by those streams returned from the method. It is also possible 17 performed by those streams returned from the method. It is also possible
18 to encapsulate datagrams. If authentication method supports such 18 to encapsulate datagrams. If authentication method supports such
19 encapsulation an instance of the UDPEncapsulation interface should be 19 encapsulation an instance of the UDPEncapsulation interface should be
20 returned as third element of the array, otherwise either null should be 20 returned as third element of the array, otherwise either null should be
21 returned as third element, or array should contain only 2 elements. 21 returned as third element, or array should contain only 2 elements.
22 22
23 @param methodId Authentication method selected by the server. 23 @param methodId Authentication method selected by the server.
24 @param proxySocket Socket used to conect to the proxy. 24 @param proxySocket Socket used to conect to the proxy.
25 @return Two or three element array containing 25 @return Two or three element array containing
26 Input/Output streams which should be used on this connection. 26 Input/Output streams which should be used on this connection.
27 Third argument is optional and should contain an instance 27 Third argument is optional and should contain an instance
28 of UDPEncapsulation. It should be provided if the authentication 28 of UDPEncapsulation. It should be provided if the authentication
29 method used requires any encapsulation to be done on the 29 method used requires any encapsulation to be done on the
30 datagrams. 30 datagrams.
31 */ 31 */
32 Object[] doSocksAuthentication(int methodId, java.net.Socket proxySocket) 32 Object[] doSocksAuthentication(int methodId,java.net.Socket proxySocket)
33 throws java.io.IOException; 33 throws java.io.IOException;
34 } 34 }