WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: configure polipo ...  (Read 4692 times)

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
configure polipo ...
« on: November 05, 2015, 11:09:47 AM »
The problem is:

I cannot reach the tinycore forums thru the tor network (many, if not all tor exit nodes are rejected; as spammers etc. One can well imagine why ... ;) :-( ).

My setup is like this: I use polipo as proxy (127.0.0.1:8118) which forwards to tor as parent socks proxy: 127.0.0.1:950 (sockstype 4a).

Now, i do not know, how to define exceptions in polipo (in privoxy i can define certain servers whereto privoxy does not filter and therefore not even forward). But i'm unaware how to do this in polipo. May be someone of you here knows (?)

Thanks a lot in advance!

Offline ptr

  • Newbie
  • *
  • Posts: 7
Re: configure polipo ...
« Reply #1 on: November 09, 2015, 01:16:39 PM »
The Torproject seems to use no longer polipo and vidalia.

Therefore I extracted the actual version (5.0.4) but " ./start-tor-browser -v " gave the hint: unable to detect whether 32 or 64-version installed therefore closed. I think the special Tinycore-build is the reason for the start-problem.

May be it would be useful if someone have a tip to solve this problem.  Then you no longer need to configure polipo.

Greetings. ptr


Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: configure polipo ...
« Reply #2 on: November 10, 2015, 02:40:03 PM »
The Torproject seems to use no longer polipo and vidalia.

Therefore I extracted the actual version (5.0.4) but " ./start-tor-browser -v " gave the hint: unable to detect whether 32 or 64-version installed therefore closed. I think the special Tinycore-build is the reason for the start-problem.

May be it would be useful if someone have a tip to solve this problem.  Then you no longer need to configure polipo.

Greetings. ptr

Obviously, i was not clear. I know Tor since a long time is shipping the TBB, which is a nice option, if it exists. But in the tce extensions there is only tor (the commandline socksproxy). Since FF is able to directly forward to a socks proxy so no problem (exception made that FF only does socks 4 ord socks 5 but not 4a which seems to be the safest option; polipo on its behalf can). But i prefer to use polipo (or better: privoxy - next time soon, i'll try to make my own extension) as a forwarding prtoxy because it can be used to do add-blocking by an external redirector file).

The practical problem is that the host of the TCL forum rejects most tor exit addresses (because as one can easily imagine, there are also widely abused by spammers). Now, i'd like to have the option to except the TCL host from being forwarded thru tor (another instance where that comes handy is e.g the url of your router which does not like when you address it via tor ;) ). In privoxy that is easily possible, but i do not see where to do that in polipo. So i hoped, someone of the experts around here would know that, eventually ...

Cheers.

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: configure polipo ...
« Reply #3 on: November 16, 2015, 02:37:39 PM »
Replying to myself: I created my own extension of privoxy, but in some way it's not fun to deal with, since the directories are too much close to a classical linux installation and i do not succeed in getting it working like it should. So for the moment, i help me out with a proxy-switcher extensions (turning off the proxy, when connecting to forum.tinycorelinux.net).

In the polipo mailing list i got the advice to use a PAC file to do what i intend to do. But before doing so, i've to learn what that is and how it works.

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: configure polipo ... [SOLVED]
« Reply #4 on: November 16, 2015, 03:53:08 PM »
The solution was easier, than i thought.  :D :D

1) I created a file 'proxy.pac' with this content:
Code: [Select]
function FindProxyForURL(url, host) {
    if ( localHostOrDomainIs(host, "forum.tinycorelinux.net") ) {
        return "DIRECT";
    } else {
        return "PROXY 127.0.0.1:8118";
    }
}
(1)

2) I put the reference to this file ('file:///home/tc/proxy.pac') into Firefox>Preferences>Advanced>Network>Settings into the field "Automatic Proxy Configuration Url and activated it.

That's it. Now, connecting to TCL forum polipo>tor is excepted from the general use of the polipo>tor combo.

Just a question to you experienced scripters: How could i add other exceptions in that script? Just a row, separated by commata?
----
1) This sites were a big help:
http://www.cyberciti.biz/faq/howto-use-auto-config-proxy-pac-file-for-specific-domain/
https://calomel.org/proxy_auto_config.html
« Last Edit: November 16, 2015, 03:54:56 PM by emninger »

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: configure polipo ...
« Reply #5 on: November 22, 2015, 03:31:26 AM »
I think i should say this, in case someone else eventually has the same or similar issues:

1) I developped a bit the proxy.pac file. Now, it looks like this:
Code: [Select]
function FindProxyForURL(url, host) {
// forum.tinycore does not like tor:
if (shExpMatch(host, "forum.tinycorelinux.net") ) {
        return "DIRECT";
// no proxy for internal net:
if (isInNet(host, "192.0.0.0", "255.255.248.0") ) {
return "DIRECT";
} else {
        return "PROXY 127.0.0.1:8118";
}
}   
 

It works, but once it changed to "DIRECT" it seems from now on, the proxy isn't used at all anymore. Since i suspected, that might be due to polipo naming the proxy "localhost:8118" (and not "127.0.0.1:8118" like most forwarding proxies do - and the tor socks proxy too (port: 9050) - i tried to change the else statement to "localhost" but the pac file still failed.

So in the end, i did FF > Settings > Advanced > Network a manual configuration and filled in several exceptions, among them forum.tinycore.net. And this indeed works. As long as you only use firefox (and no other browser), i think that is sufficient. Other apps you would like to "torify" you always could direct thru tor by torsocks or proxychains. IME (on other linux's) that's better than a systemwide proxy - at least on desktop computers - because with a systemwide socks proxy risks to break wget e.g.