@@ -87,9 +87,6 @@ internal static class Socks5Helper
87
87
88
88
private const int BufferSize = 512 ;
89
89
90
- //TODO Maybe need to change the name of the ReadMethods... It's more like interpret
91
- //Need to specify all create request methods return the bytes of the message
92
-
93
90
public static void PerformSocks5Handshake ( Stream stream , EndPoint endPoint , Socks5AuthenticationSettings authenticationSettings , CancellationToken cancellationToken )
94
91
{
95
92
var ( targetHost , targetPort ) = endPoint . GetHostAndPort ( ) ;
@@ -102,7 +99,7 @@ public static void PerformSocks5Handshake(Stream stream, EndPoint endPoint, Sock
102
99
stream . Write ( buffer , 0 , greetingRequestLength ) ;
103
100
104
101
stream . ReadBytes ( buffer , 0 , 2 , cancellationToken ) ;
105
- var acceptsUsernamePasswordAuth = ProcessGreetingResponse ( buffer , useAuth , authenticationSettings , cancellationToken ) ;
102
+ var acceptsUsernamePasswordAuth = ProcessGreetingResponse ( buffer , useAuth ) ;
106
103
107
104
if ( useAuth && acceptsUsernamePasswordAuth )
108
105
{
@@ -137,7 +134,7 @@ public static async Task PerformSocks5HandshakeAsync(Stream stream, EndPoint end
137
134
var greetingRequestLength = CreateGreetingRequest ( buffer , useAuth ) ;
138
135
await stream . WriteAsync ( buffer , 0 , greetingRequestLength , cancellationToken ) . ConfigureAwait ( false ) ;
139
136
140
- var acceptsUsernamePasswordAuth = ProcessGreetingResponse ( buffer , useAuth , authenticationSettings , cancellationToken ) ;
137
+ var acceptsUsernamePasswordAuth = ProcessGreetingResponse ( buffer , useAuth ) ;
141
138
142
139
if ( useAuth && acceptsUsernamePasswordAuth )
143
140
{
@@ -178,7 +175,7 @@ private static int CreateGreetingRequest(byte[] buffer, bool useAuth)
178
175
return 4 ;
179
176
}
180
177
181
- private static bool ProcessGreetingResponse ( byte [ ] buffer , bool useAuth , Socks5AuthenticationSettings authenticationSettings , CancellationToken cancellationToken )
178
+ private static bool ProcessGreetingResponse ( byte [ ] buffer , bool useAuth )
182
179
{
183
180
VerifyProtocolVersion ( buffer [ 0 ] ) ;
184
181
var method = buffer [ 1 ] ;
0 commit comments