Plugs into Apache's HTTP async client to open a connection via a SOCKSv4 proxy.
This proxy can be set per request with the RequestConfig
.
It currently only supports SOCKSv4.
Adding SOCKSv4a and SOCKSv5 should be straightforward with the given extension points.
Either a new session scheme socks5
could be added or the SOCKS connection handling be adapted like in
java.net.SocksSocketImpl
that can degrade von v5 to v4.
- A
SchemeIOSessionStrategy
is injected that supports thesocks
scheme.- It wraps the
IOSession
in aSocks4IOSession
- The
Socks4IOSession
puts itself on theIOSession
with a session attribute - A SOCKS
connect
package is sent (see RFC)
- It wraps the
- In order to be able to await the SOCKS reply the
DefaultConnectingIOReactor
was extended withSocksConnectingIOReactor
to wrap theIOEventDispatch
onexecute(..)
with theSocksIOEventDispatchProxy
- The
SocksIOEventDispatchProxy
- extracts the
Socks4IOSession
from the session attributes oninputReady(..)
Socks4IOSession
receives and verifies the SOCKS response- does some ugly error handling
- extracts the