3

I am currently working on building a simple HTTP proxy using Apache Mina, in particular org.apache.mina.proxy, and I have a few questions about how to use some of the components.

  • How do I extract the future address from an incoming HTTP request? I can see how to create a ProxyConnection given a URL, but I can't see how to extract this from an incoming request. I have a feeling this leads to my next question:

  • What is AbstractHttpLogicHandler for? I see it has a subclass, HttpSmartProxyHandler, but I am not sure if and how to use it.

  • Is there an example somewhere that I could look at? I've been looking at http://mina.apache.org/report/trunk/xref/org/apache/mina/example/proxy/ but it doesn't seem to answer my questions above.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
SlappyTheFish
  • 2,344
  • 3
  • 34
  • 41

2 Answers2

1

I think that classes in org.apache.mina.proxy are classes to add proxy in you HTTP request and not classes you can directly used to build your proxy.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
rno
  • 11
  • 2
0

About your second point: AbstractHttpLogicHandler is an abstract class that decorates AbstractProxyLogicHandler

"AbstractHttpLogicHandler provides HTTP request encoding/response
decoding functionality"

HttpSmartProxyHandler is a concrete class that extends AbstractProxyLogicHandler. This class fulfills its contract by handling a HTTP response from the proxy server (by implementing handleResponse(final HttpProxyResponse response))

Destroyica
  • 4,147
  • 3
  • 33
  • 50