mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Therning <nik...@trillian.se>
Subject Re: Proxy filter
Date Thu, 07 Jun 2007 06:54:24 GMT
Chris Audley wrote:
> I'd like to implement some proxy filters for MINA, filters that would
> handle the details of opening a connection through a web or socks proxy.
> The problem is, MINA filters have no influence over how the session is
> opened.  How can MINA be extended to give filters the opportunity to
> redirect a session to a proxy address?

I guess you could implement an IoConnector to accompany your filter. The
IoConnector would need a SocketConnector to delegate to. When connect()
is called it will modify the remote address to point to the proxy
instead and then call connect() on the SocketConnector. It would also
add your proxy filter to the filter chain when a connection to the proxy
has been established. The proxy filter would then take care of the
authentication and initial handshake much like the SSLFilter does. Once
the proxy has established a connection to the original remote address
the proxy filter will have to notify the ConnectFuture returned by the
proxy IoConnector and call sessionCreated/sessionOpened.

Niklas Therning

View raw message