Re: Switch forward rules on-the-fly?

Az <[email protected]>
Newsgroups gmane.comp.web.privoxy.user
Message-ID <20181010144818.GC26272@localhost>
On Wednesday 10 October 2018 15:55,
Fabian Keil <[email protected]> put forth the proposition:
> Az <[email protected]> wrote:
>
> > On Sunday 7 October 2018 08:49,
> > Az <[email protected]> put forth the proposition:
> > > On Sunday 7 October 2018 07:59,
> > > Az <[email protected]> put forth the proposition:
> > > > On Sunday 7 October 2018 06:25,
> > > > Az <[email protected]> put forth the proposition:
>
> > > > > I use a text browser with Tor quite a lot and often come up against
> > > > > captchas. When this happens I usually go through a different proxy,
> > > > > but then I lose the privoxy protection. It's either that or boot X11
> > > > > and a GUI browser, find the site again and complete the captcha.
> > > > >
> > > > > Is there a way of switching from one proxy to another somehow via my
> > > > > browser that doesn't involve turning off privoxy or adding a rule for
> > > > > each site that this happens with? With my regular sites I do add
> > > > > rules to go direct or via a plain http proxy, but I don't want to do
> > > > > it for every random site that uses cloudflare etc., which seem to be
> > > > > on the increase now.
> > > > >
> > > > > I'm kind of thinking something I could add to the URL to let privoxy
> > > > > know that I need to use a different forward rule. I looked at tags,
> > > > > but I'm not sure I really understand if they could work for what I
> > > > > want.
> > > >
> > > > Well I almost had something working. I added /1234567890 on to the
> > > > end of a URL and set up a simple redirect like s@/1234567890$@@. It
> > > > worked OK for http, but of course not for https.
> > > >
> > > > Then I tried adding a subdomain 'forward-socks5.' to the start, but
> > > > it fails with this error:
> > > >
> > > > Error: pcrs command "s@forward-socks5.@@" changed
> > > > "forward-socks5.duckduckgo.com:443" to "duckduckgo.com:443" (1 hit), but the
> > > > result doesn't look like a valid URL and will be ignored.
> > > >
> > > > Why is this URL seen as an error?
> > > >
> > > > The actual URL I entered in the browser was
> > > >
> > > > https://forward-socks5.duckduckgo.com/lite/
> > >
> > > Sorry to keep answering my own questions :)
> > >
> > > I found add the https:// seems to work so far.
> >
> > OK. Redirect obviously isn't going to work, because the browser will
> > get passed to Tor again after the redirect. What I need is to
> > *rewrite* the URL without the browser knowing.
> >
> > So far the only thing I can see that may work is to add a TAG: on the
> > user agent, and have a script to change the user agent in my browser.
> > The problem is making sure that it gets changed back, or that the
> > rule has a timer. Adding weird user agents isn't a great idea though.
> >
> > Dunno. Maybe there's a better way.
>
> A better way is to use a client-specific tag that sets the
> forward-override action:
> https://www.privoxy.org/user-manual/config.html#CLIENT-SPECIFIC-TAG
> https://www.privoxy.org/user-manual/actions-file.html#FORWARD-OVERRIDE
>
> While this will affect all requests (from the IP address)
> you can set a small timeout that is sufficient to load
> the capture-using website.
>
> Fabian

Thanks for the reply.

I did see that section but I haven't tried it yet. I gather it means
first going to a CGI web page and selecting a tag, then going on to
the original blocked page?

What I'm using at the moment is a private browser window and setting
the user agent via a command line flag. Then a matching TAG: rule
sees it and forwards it. When I'm done I just close the window and
continue from where I was before.

I'm using elinks and so I've just set an action to send the current
page URL to an external script that runs the private browser window
using -no-connect in a new screen window.

Seems OK so far anyway.

--
Az
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.