With the old DSE Java Driver (1.8.x) I was able to connect to a cluster using Custom Netty Options like this
builder.withNettyOptions(new MyNettyOptions("127.0.0.1", 10080));
import java.net.InetSocketAddress; import com.datastax.driver.core.NettyOptions; import io.netty.channel.socket.SocketChannel; import io.netty.handler.proxy.Socks5ProxyHandler; public class MyNettyOptions extends NettyOptions { private String socksProxyHost; private Integer socksProxyPort; @Override public void afterChannelInitialized(SocketChannel channel) throws Exception { channel.pipeline().addFirst(new Socks5ProxyHandler(new InetSocketAddress(socksProxyHost, socksProxyPort))); } public MyNettyOptions(String socksProxyHost, Integer socksProxyPort) { super(); this.socksProxyHost = socksProxyHost; this.socksProxyPort = socksProxyPort; } }
builder.build();
How do I achieve the same in the new 2.2.0 driver (which uses the 4.2 Cassandra driver), reference https://docs.datastax.com/en/developer/java-driver/4.2/upgrade_guide/
Looks like I can only set the SocketOptions via advanced.socket in config, but how do I modify the channel pipeline now? If that's not possible, is there any way to connect via a SOCKS proxy or it is gone now?