Hi

There is a simpler solution with delegate.

I have run a squid on localhost 127.0.0.1:3128

I have run delegate with PROXY module

delegate9.9.13$ src/delegated -f -vv -P127.0.0.1:8081 PROXY=127.0.0.1:3128

and now the swiss army knife curl was the haproxy simulator.

echo 'GET http://www.php.net/' |curl -v telnet://127.0.0.1:8081

Squid Log:

tail -f /var/log/squid/access.log
1513036938.918 51 127.0.0.1 TCP_MISS/200 30908 GET http://www.php.net/ - HIER_DIRECT/82.100.240.32 text/html

delegate log:

###
12/12 01:02:18.87 [26188] 1+1: ConnectToServer connected [19] {127.0.0.1:3128 <- 127.0.0.1:38250} [0.000s]
12/12 01:02:18.87 [26188] 1+1: willSTLS_SV[http]: ServerFlags=0 1EAC00E0
12/12 01:02:18.87 [26188] 1+1: HTTP => (www.php.net:80) GET /^M
12/12 01:02:18.87 [26184] 1+0: AcceptByMain: start polling(15000)[11]...
12/12 01:02:18.87 [26188] 1+1: KeepAlive[19] = 1
12/12 01:02:18.87 [26188] 1+1: #PROXY REQUEST = GET http://www.php.net/ HTTP/0.9^M
###

I know that the last version is from 2014 but I don't know any other tool which can handle the tcp to http proxy task.

Regards
aleks

------ Originalnachricht ------
Von: "Aleksandar Lazic" <al-hapr...@none.at>
An: "Moemen MHEDHBI" <mmhed...@haproxy.com>; "Gbg" <garb...@gmx.de>; haproxy@formilux.org
Gesendet: 11.12.2017 20:11:48
Betreff: Re[2]: Use haproxy 1.8.x to balance web applications only reachable through Internet proxy

Hi.

------ Originalnachricht ------
Von: "Moemen MHEDHBI" <mmhed...@haproxy.com>
An: "Gbg" <garb...@gmx.de>; haproxy@formilux.org
Gesendet: 11.12.2017 18:45:16
Betreff: Re: Use haproxy 1.8.x to balance web applications only reachable through Internet proxy

On 11/12/2017 17:21, Gbg wrote:
Hello      Moemen,

unless I got this wrong this isn't the setup I search for. I don't need haproxy to *be* a proxy but rather *use* a proxy while serving content over http as a reverse proxy

    Perhaps I should have given the thread this name

I get your point, HAProxy does not support using a "http/socks proxy". HAProxy intends to be "an HTTP reverse-proxy" retrieving resources from backend servers and the requests sent to a server are different from the ones sent to a "forward proxy". That being said HAProxy can still "pass" proxy requests to http/socks proxies if the client is configured to use a proxy.
How about to use delegate ( http://delegate.org/documents/ ) for this, just as an idea.

haproxy -> delegate FORWARD=... CONNECT=proxy:<your-proxy>

http://delegate.org/delegate/Manual.shtml?FORWARD
http://delegate.org/delegate/Manual.shtml?CONNECT

I know it's not that elegant but it could work.


  ++

Am 11. Dezember 2017 16:56:12 MEZ schrieb Moemen MHEDHBI <mmhed...@haproxy.com> <mailto:mmhed...@haproxy.com>:
On 11/12/2017 15:02, Gbg wrote:

I need to contact applications through a socks or http proxy.

My current setup looks like this but only works when the Computer
haproxy runs on has direct Internet connection (which is not the case
in our datacenter, I tried this at home)

frontend main
bind *:8000
acl is_extweb1 path_beg -i /policies
acl is_extweb2 path_beg -i /produkte
use_backend externalweb1 if is_extweb1
use_backend externalweb2 if is_extweb2

backend externalweb1
server static www.google.com:80 check

backend externalweb2
server static www.gmx.net:80 check

There is an SO post which addresses the same question and provides
some more details:
https://stackoverflow.com/questions/47605766/use-haproxy-as-an-reverse-proxy-with-an-application-behind-internet-proxy




Hi Gbg,

For this to work you need the client (browser for example) to be aware
of the forward proxy.
So first you need to configure the client to use HAProxy as a forward proxy, then in the HAProxy conf you need to use the forward proxy in the
backend and the configuration may look like this:

frontend main
bind *:8000
acl is_extweb path_beg -i /policies /produkte
use_backend forward_proxy if is_extweb
default_backend another_backend

backend forward_proxy
 server static < IP-of-the-forward-proxy > : < Port > check


++

Moemen MHEDHBI





    --
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

--
Moemen MHEDHBI






Reply via email to