SocksProxyRequest req; if (proxyVersion.equalsIgnoreCase("4")) { req = new SocksProxyRequest( SocksProxyConstants.SOCKS_VERSION_4, SocksProxyConstants.ESTABLISH_TCPIP_STREAM, req = new SocksProxyRequest( SocksProxyConstants.ESTABLISH_TCPIP_STREAM, address.getAddress().getHostAddress(), req = new SocksProxyRequest( SocksProxyConstants.SOCKS_VERSION_5, SocksProxyConstants.ESTABLISH_TCPIP_STREAM, req.setPassword(proxyPassword);
/** * Return the server port as a byte array. * * @return the server port */ public byte[] getPort() { byte[] port = new byte[2]; int p = (getEndpointAddress() == null ? this.port : getEndpointAddress().getPort()); port[1] = (byte) p; port[0] = (byte) (p >> 8); return port; }
boolean isV4ARequest = Arrays.equals(request.getIpAddress(), SocksProxyConstants.FAKE_IP); byte[] userID = request.getUserName().getBytes("ASCII"); byte[] host = isV4ARequest ? request.getHost().getBytes("ASCII") : null; buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put(request.getPort()); buf.put(request.getIpAddress()); buf.put(userID); buf.put(SocksProxyConstants.TERMINATOR);
InetSocketAddress adr = request.getEndpointAddress(); byte addressType = 0; byte[] host = null; host = request.getHost() != null ? request.getHost().getBytes("ASCII") : null; buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put((byte) 0x00); // Reserved buf.put(addressType); buf.put(request.getIpAddress()); } else { buf.put((byte) host.length); buf.put(request.getPort());
byte[] user = request.getUserName().getBytes("ASCII"); byte[] pwd = request.getPassword().getBytes("ASCII"); IoBuffer buf = IoBuffer.allocate(3 + user.length + pwd.length);
/** * 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; }
GSSName serverName = manager.createName(request.getServiceKerberosName(), null); Oid krb5OID = new Oid(SocksProxyConstants.KERBEROS_V5_OID);
boolean isV4ARequest = Arrays.equals(request.getIpAddress(), SocksProxyConstants.FAKE_IP); byte[] userID = request.getUserName().getBytes("ASCII"); byte[] host = isV4ARequest ? request.getHost().getBytes("ASCII") : null; buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put(request.getPort()); buf.put(request.getIpAddress()); buf.put(userID); buf.put(SocksProxyConstants.TERMINATOR);
throws UnsupportedEncodingException { int len = 6; InetSocketAddress adr = request.getEndpointAddress(); byte addressType = 0; byte[] host = null; host = request.getHost() != null ? request.getHost().getBytes("ASCII") : null; buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put((byte) 0x00); // Reserved buf.put(addressType); buf.put(request.getIpAddress()); } else { buf.put((byte) host.length); buf.put(request.getPort());
byte[] user = request.getUserName().getBytes("ASCII"); byte[] pwd = request.getPassword().getBytes("ASCII"); IoBuffer buf = IoBuffer.allocate(3 + user.length + pwd.length);
/** * 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; }
GSSName serverName = manager.createName(request.getServiceKerberosName(), null); Oid krb5OID = new Oid(SocksProxyConstants.KERBEROS_V5_OID);
final SocksProxyRequest request) { try { boolean isV4ARequest = request.getHost() != null; byte[] userID = request.getUserName().getBytes("ASCII"); byte[] host = isV4ARequest ? request.getHost().getBytes("ASCII") : null; buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put(request.getPort()); buf.put(request.getIpAddress()); buf.put(userID); buf.put(SocksProxyConstants.TERMINATOR);
InetSocketAddress adr = request.getEndpointAddress(); byte addressType = 0; byte[] host = null; host = request.getHost() != null ? request.getHost().getBytes("ASCII") : null; buf.put(request.getProtocolVersion()); buf.put(request.getCommandCode()); buf.put((byte) 0x00); // Reserved buf.put(addressType); buf.put(request.getIpAddress()); } else { buf.put((byte) host.length); buf.put(request.getPort());
byte[] user = request.getUserName().getBytes("ASCII"); byte[] pwd = request.getPassword().getBytes("ASCII"); IoBuffer buf = IoBuffer.allocate(3 + user.length + pwd.length);
SocksProxyRequest req; if (proxyVersion.equalsIgnoreCase("4")) { req = new SocksProxyRequest( SocksProxyConstants.SOCKS_VERSION_4, SocksProxyConstants.ESTABLISH_TCPIP_STREAM, req = new SocksProxyRequest( SocksProxyConstants.ESTABLISH_TCPIP_STREAM, address.getAddress().getHostAddress(), req = new SocksProxyRequest( SocksProxyConstants.SOCKS_VERSION_5, SocksProxyConstants.ESTABLISH_TCPIP_STREAM, req.setPassword(proxyPassword);
/** * Return the server port as a byte array. * * @return the server port */ public byte[] getPort() { byte[] port = new byte[2]; int p = (getEndpointAddress() == null ? this.port : getEndpointAddress().getPort()); port[1] = (byte) p; port[0] = (byte) (p >> 8); return port; }
/** * 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; }
.getServiceKerberosName(), null); Oid krb5OID = new Oid(SocksProxyConstants.KERBEROS_V5_OID);
SocksProxyRequest req; if (proxyVersion.equalsIgnoreCase("4")) { req = new SocksProxyRequest( SocksProxyConstants.SOCKS_VERSION_4, SocksProxyConstants.ESTABLISH_TCPIP_STREAM, req = new SocksProxyRequest( SocksProxyConstants.ESTABLISH_TCPIP_STREAM, address.getAddress().getHostAddress(), req = new SocksProxyRequest( SocksProxyConstants.SOCKS_VERSION_5, SocksProxyConstants.ESTABLISH_TCPIP_STREAM, req.setPassword(proxyPassword);