List of usage examples for io.netty.handler.proxy Socks4ProxyHandler Socks4ProxyHandler
public Socks4ProxyHandler(SocketAddress proxyAddress)
From source file:io.airlift.drift.transport.netty.client.ThriftClientInitializer.java
License:Apache License
@Override protected void initChannel(SocketChannel channel) { ChannelPipeline pipeline = channel.pipeline(); socksProxyAddress.ifPresent(socks -> pipeline .addLast(new Socks4ProxyHandler(new InetSocketAddress(socks.getHost(), socks.getPort())))); sslContextSupplier.ifPresent(sslContext -> pipeline.addLast(sslContext.get().newHandler(channel.alloc()))); transport.addFrameHandlers(pipeline, Optional.of(protocol), maxFrameSize, true); pipeline.addLast(new ThriftClientHandler(requestTimeout, transport, protocol)); }
From source file:io.airlift.drift.transport.netty.ThriftClientInitializer.java
License:Apache License
@Override protected void initChannel(SocketChannel channel) { ChannelPipeline pipeline = channel.pipeline(); messageFraming.addFrameHandlers(pipeline); pipeline.addLast(new ThriftClientHandler(requestTimeout, messageEncoding)); sslContext.ifPresent(sslContext -> pipeline.addFirst(sslContext.newHandler(channel.alloc()))); socksProxyAddress.ifPresent(socks -> pipeline .addFirst(new Socks4ProxyHandler(new InetSocketAddress(socks.getHost(), socks.getPort())))); }