Discussion:
[privoxy-users] Multiple Privoxy for multi SOCKS tunnel?
Jean Seurin
2015-11-25 02:43:56 UTC
Permalink
Hi all,

I'm in a situation where using internet requires channeling the traffic
through a range of SOCKS proxies.
According to the situation of the network, one manually selects the most
efficient proxy of the moment.

I got addicted to Privoxy and don't even want to surf the web without
it. I have it setup in upstream of the generally most efficient proxy
and forward-socks5 to it.

Right now, the only solution I can imagine to be able to switch proxy
while still benefit from privoxy's features is to setup a privoxy
instance per SOCKS proxy.
That's workable as it's simple to setup and memory footprint is low, but
at the very least I need to share the configuration.
My guess is that I could simply configure each instance to use the same
config file. This would work right?

Still that's the worst case scenario. I'd rather have a unique instance
of Privoxy that I would be able to manually redirect to a specific SOCKS
with minimum work.

Does anyone has a idea on how to implement such a scenario?

I've been successfully using `socat` to redirect UDP DNS traffic, would
that work for SOCKS proxy traffic as well?

Cheers
Fabian Keil
2015-11-25 15:00:24 UTC
Permalink
Post by Jean Seurin
I'm in a situation where using internet requires channeling the traffic
through a range of SOCKS proxies.
According to the situation of the network, one manually selects the most
efficient proxy of the moment.
I got addicted to Privoxy and don't even want to surf the web without
it. I have it setup in upstream of the generally most efficient proxy
and forward-socks5 to it.
Right now, the only solution I can imagine to be able to switch proxy
while still benefit from privoxy's features is to setup a privoxy
instance per SOCKS proxy.
A single Privoxy instance can be configured to use multiple SOCKS
proxies and select them based on the request URL or other request
headers.

The client-header-tagger{} documentation contains an example:
https://config.privoxy.org/user-manual/actions-file.html#CLIENT-HEADER-TAGGER

This way you can change the forwarder by changing one of the client
headers.
Post by Jean Seurin
That's workable as it's simple to setup and memory footprint is low, but
at the very least I need to share the configuration.
My guess is that I could simply configure each instance to use the same
config file. This would work right?
Using the same config file will result in the instances trying
to bind to the same listen address. This can work if the instances
are jailed (or if the network is virtualized) but most operating
systems have no support for this.

Sharing action and filter files should work on all systems, though.
Post by Jean Seurin
Still that's the worst case scenario. I'd rather have a unique instance
of Privoxy that I would be able to manually redirect to a specific SOCKS
with minimum work.
Does anyone has a idea on how to implement such a scenario?
I've been successfully using `socat` to redirect UDP DNS traffic, would
that work for SOCKS proxy traffic as well?
While you can use socat to redirect Privoxy's SOCKS traffic you can also use
a dedicated action file for the socks configuration and regenerate it to change
the forwarder. Using links for this works as well.

Fabian

Loading...