[Privoxy-users] user-agent based forwarding action

Fabian Keil fk at fabiankeil.de
Sat Jun 24 13:51:59 UTC 2017


privoxyusers2 at i.lucanops.net wrote:

> On Sun, 18 Jun 2017 12:42:57 +0300
> Beeblebrox <zaphod at berentweb.com> wrote:
> > Hello, this should have been trivial but I'm stuck (privoxy-3.0.2).
> > 
> > Trying to get forwarding rule based on user-agent. I have replaced
> > the user-agent string in the browser with simple "Explorer SunOS" for
> > testing (no filter definitions) and edited user.action file as:
> > 
> > ###################
> > # Crunch referrer
> > { +crunch-client-header{Referer:} }
> > /
> > 
> > # Spoof accept-language and user agent
> > {+hide-accept-language{en-ca} \
> > +hide-user-agent{Mozilla/5.0 (X11; U; Linux; i686; en-ca; rv:1.7)
> > KHTML (like Gecko)}  } /  
> 
> After writing the stuff below, I noticed this. Could the problem be
> because you are trying to hide the UA, but then tag against it? How do
> things go if you comment out the above line?

Header taggers are executed before the headers are modified.

> Because I have a mixture of sites and UAs in my action file I am not
> sure about this, but if you set your UA and visit an HTTPS site,
> Privoxy won't know the UA and the override will not apply. I think
> pretty much all headers are encrypted, and so Privoxy can't know about
> the UA. Please can someone say if this is wrong?

In case of https requests the browser first sends an unencrypted
CONNECT request to Privoxy. Whether or not that request contains
a User-Agent header is up to the client (most clients seem to send it).

You can enable "debug 8" to see which headers your clients send
in case of CONNECT requests.
 
Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-users/attachments/20170624/b24da512/attachment.bin>


More information about the Privoxy-users mailing list