txthinking/brook

Transparent proxy

limon opened this issue · 10 comments

limon commented

I run brook on my router. Is there any way to setup a transparent proxy easily, like ss-redir?

same as #102 ?

limon commented

no, not a tunnel.
I need something like this: https://gist.github.com/wen-long/8644243
which use iptables to rediect packets, and clients through the router won't aware any change.

you must install redsocks in route in order to a transparent proxy. I wish add the feature in Brook.

This feature is implemented in v20180227.
Please have a try with https://github.com/txthinking/brook/tree/master/scripts

My situation:

  • I have a Linux box (IP: 192.168.1.100)
  • I have a MacOS (IP: 192.168.1.9)

Steps:

  1. Deploy a brook server
  2. Download brook cli on Linux box
  3. Run $ brook tproxy -l :1080 -s BROOK_SERVER_IP:PORT -p PASSWORD on Linux box
  4. Run $ iproute.sh on Linux box
  5. Run $ iptables.sh with BROOK_SERVER_IP and BROOK_TPROXY_PORT(1080) on Linux box
  6. Setup gateway with 192.168.1.100, dns server with 8.8.8.8 on MacOS

the feature is not available when using iptable redirect, ex
iptables -t nat -A BROOK -p tcp -j REDIRECT --to-ports 1080 (BROOK_TPROXY_PORT)

How to deploy the firewall when brook is installed on Openwrt Route?
Unlike ss-redir, the transparent feature is not available using iptable redirect function.

@nuclearn Brook tproxy works on mangle table