[squid-users] Redirect request to cache_peer using username and passwords

Amos Jeffries squid3 at treenet.co.nz
Thu Jul 2 10:43:54 UTC 2020

On 2/07/20 9:49 pm, Prem Chand wrote:
> Hi,
> I need to redirect my clients requests to different Cache_peers using
> username and passwords through my proxy. Below is the rough sketch. Can
> someone suggest to me how I can achieve this?

FYI: "redirect" is the wrong word, has a meaning in HTTP completely
different from what you are talking about.

Peers are for message *routing*.

> Client1(Username1:password1) ->Proxy:443 -> Cache_peer:3218
> Client 2(Username2:password2)->Proxy:443-> Cache_peer:3219
> .

That is possible.

However, what do you want to happen when that users dedicated peer is
 Stop all access for them?

 Failover to going "DIRECT" instead of through the peer?

 Use some other peer, and if so which one and based on what criteria?

> This is my current configuration, I'm doing round robin through
> cache_peers when authenticated with a single username and password in
> /etc/squid/squidpasswdfile file

Are you wanting to keep this behaviour?

You can select a group of peers that each user has access to and apply
round-robin to them. However, any peer that is used by more than one
user will have its RR calculation implemented by *both* to prevent overuse.
 So the RR behaviour will not be easily visible. Selected peer (single
only) will be whichever one the user is allowed to access *and*
currently had least traffic going there.


More information about the squid-users mailing list