[squid-users] select parent proxy based on ACL

Pascal Watteel pascal at watteel.be
Wed Apr 6 13:14:10 UTC 2016

Ok maybe it was't all clear.

I live in Dubai. Our local ISP limits the bandwith per TCP connection
when connections are made outside of the gulf.
Don't ask me why, they just do.
I have a fast 128Mbit link but as i'm limited to 4Mbit per TCP, the
moment i download a file from a non local mirror it's slow.

Aria2c or Uget works perfect on my desktop but i wanted a solution that
would work universal without any software on a pc.

the solution is ranged downloads if the server supports it.
This will make my download split in example 16 ranged byte gets -> 16
TCP connections => 16X 4Mbit => descent download speed.

My solution was to write a python based proxy.

It does exaclty that but in a proxy form. 
Anything that is not .iso .zip or other that you can define in the
config will just be transparent. Anything that is defined will be split
in segmented downloads and so downloaded faster on my ISP.

Now i already have a Squid proxy in my network with a another Squid
proxy parent in AWS.
I use the proxy for local caching nothing fancy, But use the parent
with an acl to send specific domains to the parent and so enable me to
access sites without the need of a VPN.

I now want to add my Python based proxy as another parent.
However i have no option to tell squid what parent to use.
I would like to create a regex acl in squid and someway tell squid to
use parent proxy X for ACL_X and parent proxy Y for ACL Y.
But i can only use the ACL to say direct or indirect.

And use the proxy-peer-domain statement to choose the parent based on a
domain or tld.

so my question is how to make squid choose the parent based on an ACL.

hope this explanes it better for you.
what my parent does, is not important. It could be anyother parent

On Thu, 2016-04-07 at 00:00 +1200, Amos Jeffries wrote:
> On 6/04/2016 5:38 p.m., Pascal Watteel wrote:
> > 
> > anyone?
> NP: Messages sent at 12am should be expected to have some response
> delay. (and its always 12am somewhere in the world :-).
> > 
> > 
> > On Tue, 2016-04-05 at 12:08 +0000, Pascal Watteel wrote:
> > > 
> > > Hi peeps,
> > > 
> > > I have written a python based download accelerator based proxy.
> > > It does exactly the same thing as what aria2c would do, but as a
> > > proxy.
> Huh?
> aria2c is a "client" (or "user agent") in HTTP terminology.
> A proxy is ... a proxy. Which is to say both client and server. But
> definitely NOT a user-agent.
> So either you have written a proxy, or you have written something
> like
> aria2c. Not both.
> "accelerator" is a marketing jargon word. Particularly when used in
> the
> phrase "download acclerator".
> > 
> > > 
> > > 
> > > I now want to tell squid to only send .zip .iso .whatever to this
> > > proxy
> > > as an parent proxy.
> > > But i only find a way how to tell squid to do this for domains
> > > with
> > > peer_domain.
> > > 
> > > Is there a way how i can tell squid to decide the parent proxy
> > > based
> > > on
> > > a ACL so i can just use regex define the files i wanna send to
> > > this
> > > parent?
> > > 
> Terminology clash again. Squid does not send files anywhere. Two
> reasons
> for that:
> 1) HTTP is a "pull" protocol: Requests go out (aka "send"). Responses
> come back (aka "receive"). That is all.
> 2) HTTP has therefore no protocol concept of "files". Squid is only
> aware of the response content-type (note that its "payload" or
> "content", not 'file') when it is already on its way back to the
> client.
> Far too late to decide which server to send the request message to.
> I *think* what you are asking for is:
>  <http://www.squid-cache.org/Doc/config/cache_peer_access/>
> But I am seriously doubting whether you have the right HTTP model
> with
> all this malformed terminology you are using.
> You can approximately guess what the traffic will be by urlpath_regex
> matching the URL path values. But unless you control the servers URL
> design that is just a rough guess.
> PS. "download accelerator" is an old concept from the days 20-odd
> years
> go when networks were slow and HTTP/1.0 was wasting bandwidth to make
> things slower. As with all old concepts in HTTP Squid probably
> already
> does it in one way or several.
> In particular modern HTTP/1.1 plus Caching obsoletes almost all
> "download accelerator" designs in a much more efficient way.
>  If you describe what you actualy want the whole system to do in a
> clear
> way we can perhapse provide you with squid.conf settings to avoid
> needing the extra layer of custom proxy software.
> Amos
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users

More information about the squid-users mailing list