You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Albretch Mueller <lb...@gmail.com> on 2023/02/16 19:21:34 UTC

HC being used as poor man HTTP proxy to any extent? . . .

 Here are some examples {ClassicReverseProxyExample.html, ProxyTunnelDemo.html}
 Has anyone attempted to extend HC anywhere near a full blown HTTP
proxy like squid.
 Could you share with me any documentation you would deem valuable in
that sense?
 lbrtchx

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: HC being used as poor man HTTP proxy to any extent? . . .

Posted by Gary Gregory <ga...@gmail.com>.
I would start with one of the examples.

For anything non-trivial, you will have to dig into the HC code anyway, so
docs only go so far ;-)

Gary

On Fri, Feb 17, 2023, 01:47 Albretch Mueller <lb...@gmail.com> wrote:

> On 2/16/23, Gary Gregory <ga...@gmail.com> wrote:
> > it's proprietary though.
>
>  I understand, but in hindsight if you had to restart such a project
> again what had you done differently?, which documentation would you
> have used?
>
>  lbrtchx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: HC being used as poor man HTTP proxy to any extent? . . .

Posted by Albretch Mueller <lb...@gmail.com>.
On 2/16/23, Gary Gregory <ga...@gmail.com> wrote:
> it's proprietary though.

 I understand, but in hindsight if you had to restart such a project
again what had you done differently?, which documentation would you
have used?

 lbrtchx

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: HC being used as poor man HTTP proxy to any extent? . . .

Posted by Gary Gregory <ga...@gmail.com>.
I built a solid reverse proxy at work a couple of years ago on top of HC,
it's proprietary though. Getting the basics done is easy, relatively, but
as soon as features like CORS, OAuth, and so on come into play, then it's
hard.

Gary

On Thu, Feb 16, 2023, 14:21 Albretch Mueller <lb...@gmail.com> wrote:

>  Here are some examples {ClassicReverseProxyExample.html,
> ProxyTunnelDemo.html}
>  Has anyone attempted to extend HC anywhere near a full blown HTTP
> proxy like squid.
>  Could you share with me any documentation you would deem valuable in
> that sense?
>  lbrtchx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: HC being used as poor man HTTP proxy to any extent? . . .

Posted by Achim Kraus <ac...@cloudcoap.net>.
Not sure, if it helps.

In Eclipse/Californium I've implemented a proxy with hc-apache two years 
ago.

See
https://github.com/eclipse-californium/californium/blob/main/californium-proxy2/src/main/java/org/eclipse/californium/proxy2/http/server/HttpServer.java#L212-L232

There was a short discussion about that implementation, see:

https://lists.apache.org/thread/ddddkdv00qphxl2sysk1cnn4y29s4lzt

best regards
Achim


Am 16.02.23 um 22:54 schrieb Oleg Kalnichevski:
> On Thu, 2023-02-16 at 19:21 +0000, Albretch Mueller wrote:
>>   Here are some examples {ClassicReverseProxyExample.html,
>> ProxyTunnelDemo.html}
>>   Has anyone attempted to extend HC anywhere near a full blown HTTP
>> proxy like squid.
>>   Could you share with me any documentation you would deem valuable in
>> that sense?
>>   lbrtchx
>>
> I am not aware of any better or more advanced proxy implementation
> based on HttpCore. There is however a more suited for real-world use
> example based on the non-blocking (async) i/o model that might be a
> much better starting point. It can also potentially support HTTP/2 for
> incoming or outgoing messages, or both.
>
> https://github.com/ok2c/httpcomponents-core/blob/master/httpcore5/src/test/java/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java
>
> Hope this helps
>
> Oleg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: HC being used as poor man HTTP proxy to any extent? . . .

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2023-02-16 at 19:21 +0000, Albretch Mueller wrote:
>  Here are some examples {ClassicReverseProxyExample.html,
> ProxyTunnelDemo.html}
>  Has anyone attempted to extend HC anywhere near a full blown HTTP
> proxy like squid.
>  Could you share with me any documentation you would deem valuable in
> that sense?
>  lbrtchx
> 

I am not aware of any better or more advanced proxy implementation
based on HttpCore. There is however a more suited for real-world use
example based on the non-blocking (async) i/o model that might be a
much better starting point. It can also potentially support HTTP/2 for
incoming or outgoing messages, or both.

https://github.com/ok2c/httpcomponents-core/blob/master/httpcore5/src/test/java/org/apache/hc/core5/http/examples/AsyncReverseProxyExample.java

Hope this helps

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org