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