Example usage for io.netty.handler.proxy Socks4ProxyHandler Socks4ProxyHandler

List of usage examples for io.netty.handler.proxy Socks4ProxyHandler Socks4ProxyHandler

Introduction

In this page you can find the example usage for io.netty.handler.proxy Socks4ProxyHandler Socks4ProxyHandler.

Prototype

public Socks4ProxyHandler(SocketAddress proxyAddress) 

Source Link

Usage

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()))));
}