I'm presently focusing on creating a simple HTTP proxy using Apache Mina, particularly org.apache.mina.proxy, and I've got a couple of questions regarding using a few of the components.

  • How do you extract the near future address from an incoming HTTP request? I can easily see how to produce a ProxyConnection given a URL, however i can't observe how to extract this from an incoming request; I possess a feeling this leads to my next question:

  • What's AbstractHttpLogicHandler for? I see it features a subclass, HttpSmartProxyHandler, but I don't know if and just how to make use of it.

  • Can there be a good example somewhere which i could take a look at? I have been searching at http://mina.apache.org/report/trunk/xref/org/apache/mina/example/proxy/ however it does not appear to reply to my questions above.

Thank you ahead of time for just about any help.

Regarding your second point: AbstractHttpLogicHandler is definitely an abstract class that embellishes AbstractProxyLogicHandler

"AbstractHttpLogicHandler provides HTTP request encoding/response
decoding functionality"

HttpSmartProxyHandler is really a concrete class that stretches AbstractProxyLogicHandler. These kinds satisfies its contract by coping with HTTP response in the proxy server (by applying handleResponse(final HttpProxyResponse response))

I attempt to complete exactly the same: designed a simple HTTP proxy with Mina without better results than you :-(

However I believe that classes in org.apache.mina.proxy are classes to include proxy in your soul HTTP request and never classes you are able to directly accustomed to construct your proxy.