[Privoxy-users] user-agent based forwarding action

Beeblebrox zaphod at berentweb.com
Sun Jun 18 09:42:57 UTC 2017


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)}  }
/

{-filter{demoronizer}}

# Tag every request with the User-Agent header. Client-header taggers are
# first to be executed and can be used to control every other action.
{+client-header-tagger{user-agent}}
/

# Tagging doesn't change action, sections with TAG patterns do
# Use different forwarding based on user-agent
{+forward-override{forward-socks5 192.168.0.102:2222 .} \
+client-header-filter{hide-tor-exit-notation} }
TAG:^User-Agent: Explorer SunOS/
#########################

But forwarding does not work correctly (this example for a country-level blocked site)
Header: scan: Host: www.example.org
Header: scan: User-Agent: Explorer SunOS
Header: Tagger 'user-agent' added tag 'User-Agent: Explorer SunOS'. No action bits update necessary.
Header: Modified: User-Agent: Mozilla/5.0 (X11; U; Linux; i686; en-ca; rv:1.7) KHTML (like Gecko)
Header: crumble crunched: Proxy-Connection: keep-alive!
Header: Adding: Connection: close

1. I can only get forwarding to work from global setting in the config file so what am I missing here? Also the "forward-override" rule above would presumably forward everything EXCEPT traffic from agent "Explorer SunOS", but when I reset the browsers user-agent I get the same result.
2. Is it safe to use on-the-fly user-agent switcher/changer add-ons, if all requests go through Privoxy? I'd like to configure the rule so that only certain agents get "forward-override".

Thanks & Regards.


-- 
FreeBSD_amd64_12-Current_RadeonKMS
Please CC my email when responding, mail from list is not delivered.


More information about the Privoxy-users mailing list