/** * Encodes the initial greeting packet. * * @param request the socks proxy request data * @return the encoded buffer */ private IoBuffer encodeInitialGreetingPacket(final SocksProxyRequest request) { byte nbMethods = (byte) SocksProxyConstants.SUPPORTED_AUTH_METHODS.length; IoBuffer buf = IoBuffer.allocate(2 + nbMethods); buf.put(request.getProtocolVersion()); buf.put(nbMethods); buf.put(SocksProxyConstants.SUPPORTED_AUTH_METHODS); return buf; }
/** * Encodes the initial greeting packet. * * @param request the socks proxy request data * @return the encoded buffer */ private IoBuffer encodeInitialGreetingPacket(final SocksProxyRequest request) { byte nbMethods = (byte) SocksProxyConstants.SUPPORTED_AUTH_METHODS.length; IoBuffer buf = IoBuffer.allocate(2 + nbMethods); buf.put(request.getProtocolVersion()); buf.put(nbMethods); buf.put(SocksProxyConstants.SUPPORTED_AUTH_METHODS); return buf; }
/** * Encodes the initial greeting packet. * * @param request the socks proxy request data * @return the encoded buffer */ private IoBuffer encodeInitialGreetingPacket(final SocksProxyRequest request) { byte nbMethods = (byte) SocksProxyConstants.SUPPORTED_AUTH_METHODS.length; IoBuffer buf = IoBuffer.allocate(2 + nbMethods); buf.put(request.getProtocolVersion()); buf.put(nbMethods); buf.put(SocksProxyConstants.SUPPORTED_AUTH_METHODS); return buf; }
buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put((byte) 0x00); // Reserved
buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put((byte) 0x00); // Reserved
buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put((byte) 0x00); // Reserved
buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put(request.getPort());
if (req.getProtocolVersion() == SocksProxyConstants.SOCKS_VERSION_4) { handler = new Socks4LogicHandler(proxyIoSession); } else {
buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put(request.getPort());
if (req.getProtocolVersion() == SocksProxyConstants.SOCKS_VERSION_4) { handler = new Socks4LogicHandler(proxyIoSession); } else {
buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put(request.getPort());
if (req.getProtocolVersion() == SocksProxyConstants.SOCKS_VERSION_4) { handler = new Socks4LogicHandler(proxyIoSession); } else {