Skip to content

SOCKS proxy support broken #2139

@jaredstehler

Description

@jaredstehler

It appears that SOCKS proxy support has been silently broken somewhere in v3. As far as i can tell, none of the unit tests actually verify that traffic went through the proxy. I have an example where the request is expected to fail, and I'd expect to see a proxy connect error, which I am not seeing in v3.

I've created a repo to reproduce: https://github.com/jaredstehler/ahc-socks-proxy

Tested as fails in: 3.0.0...3.0.6
Tested as succeeds in 2.12.3...2.12.4

From debugging, it appears that there is an uncaught error in httpBootstrapHandler.handlerAdded(ctx) which causes super.handlerAdded(ctx) (and subsequently, initChannel()) to not be invoked.

The actual error occurs at:

java.util.NoSuchElementException: org.asynchttpclient.netty.channel.ChannelManager$1
	at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:1103)
	at io.netty.channel.DefaultChannelPipeline.remove(DefaultChannelPipeline.java:366)
	at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:135)
	at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:111)
	at org.asynchttpclient.netty.channel.ChannelManager$4.handlerAdded(ChannelManager.java:513)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions