private static void encodeAuthMethodResponse(Socks5InitialResponse msg, ByteBuf out) { out.writeByte(msg.version().byteValue()); out.writeByte(msg.authMethod().byteValue()); }
Socks5AuthMethod authMethod = socksAuthMethod(); if (res.authMethod() != Socks5AuthMethod.NO_AUTH && res.authMethod() != authMethod) { throw new ProxyConnectException(exceptionMessage("unexpected authMethod: " + res.authMethod()));
private static void encodeAuthMethodResponse(Socks5InitialResponse msg, ByteBuf out) { out.writeByte(msg.version().byteValue()); out.writeByte(msg.authMethod().byteValue()); }
private static void encodeAuthMethodResponse(Socks5InitialResponse msg, ByteBuf out) { out.writeByte(msg.version().byteValue()); out.writeByte(msg.authMethod().byteValue()); }
@Override void read(ConnectionFlow flow, Object msg) { if (msg instanceof Socks5InitialResponse) { Socks5AuthMethod selectedAuthMethod = ((Socks5InitialResponse) msg).authMethod(); final boolean authSuccess; if (selectedAuthMethod == Socks5AuthMethod.NO_AUTH) { // Immediately proceed to SOCKS CONNECT flow.first(SOCKS5CONNECTRequestWithChainedProxy); authSuccess = true; } else if (selectedAuthMethod == Socks5AuthMethod.PASSWORD) { // Insert a password negotiation step: flow.first(SOCKS5SendPasswordCredentials); authSuccess = true; } else { // Server returned Socks5AuthMethod.UNACCEPTED or a method we do not support authSuccess = false; } if (authSuccess) { flow.advance(); return; } } flow.fail(); }
Socks5AuthMethod authMethod = socksAuthMethod(); if (res.authMethod() != Socks5AuthMethod.NO_AUTH && res.authMethod() != authMethod) { throw new ProxyConnectException(exceptionMessage("unexpected authMethod: " + res.authMethod()));
Socks5AuthMethod authMethod = socksAuthMethod(); if (res.authMethod() != Socks5AuthMethod.NO_AUTH && res.authMethod() != authMethod) { throw new ProxyConnectException(exceptionMessage("unexpected authMethod: " + res.authMethod()));