1

I want to route http traffic of my local pptp server to use Polipo http_proxy.
So i found this QA : IPTABLES: routing VPN users through transparent Squid

but i test on my system & change iptables rule from 3128 to 8123 like this :
iptables -t nat -A PREROUTING -i ppp+ -p tcp --dport 80 -j REDIRECT --to-port 8123
When i want to get any webpage from browser i saw Polipo config page!

Am i missing to set iptables rules?

M2sh
  • 63
  • 8

1 Answers1

3

Well, as far as I know Polipo can't be used as a transparent proxy. You must install a Squid proxy or another that supports that feature. You get the Polipo config page because you are accessing directly to that port without specifying in the headers that is a proxy request. Direct and proxy requests are made and handled differently.

I'd recommend you to use Redsocks. The page comes with good examples of how to configure it and is very reliable. Just be careful not to run out of file descriptors, it will spitting the "Too many open files" error and you'll have to restart it.

PS: You can't use any proxy to do the same thing with SSL (por 443), at least without messing with the clients.

Mauricio López
  • 944
  • 4
  • 9
  • why i can't using polipo? what is different between squid & polipo? – M2sh Nov 06 '15 at 04:51
  • Polipo can run in a "transparent" proxy config, but not as "intercepting proxy". This setup won't be possible with Polipo, sorry! Source: http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/faq.html – Craig Nov 08 '15 at 22:40
  • @Craig Ok, how i can do my setup? i have only socks proxy & want to connect to it with pptp connect. i know that i can use openvpn instead of socks. so is there any software to convert http_proxy or socks into `tun` connection like openvpn? – M2sh Nov 09 '15 at 09:33
  • 1
    Redsocks is what you need for redirecting traffic to a socks proxy. http://darkk.net.ru/redsocks/. – Mauricio López Nov 09 '15 at 15:42
  • Thanks, that works. but i have question : when i set iptables to use `luser` (for example), it works fine, so now i want to set my pptp connection use `redsocks`. does pptp server run with `proxy` user? – M2sh Nov 09 '15 at 18:17
  • 1
    It depends, you can find out by using ps aux | grep pptp and checking which user is that process running with. It's usually the first field ;-) – Mauricio López Nov 09 '15 at 23:33
  • thanks. if you want, you can update your answer for suggesting `redsocks`. – M2sh Nov 10 '15 at 09:05