Total Pageviews

Friday, 15 May 2020

全局代理程序iosocks,仅支持linux桌面系统

A lightweight tunnel proxy, provides a SOCKS5 proxy and a transparent proxy.

Build

  1. install libev (optional)
    # Archlinux
    sudo pacman -S libev
    # CentOS
    sudo yum install libev-devel
    # Debian/Ubuntu
    sudo apt-get install libev-dev
  2. configure and make
    autoreconf -if
    ./configure --prefix=/usr --sysconfdir=/etc
    make
  3. install
    sudo make install

Cross compile

  1. setup cross compile tool chain
  2. build
    autoreconf -if
    ./configure --host=arm-unknown-linux-gnueabihf \
        --prefix=/usr --sysconfdir=/etc

Usage

man iosocks

Advanced usage

ioredir prorides a transpant TCP proxy. This feature requires Linux netfilter's NAT function.
iptables -t nat -N iosocks
iptables -t nat -A iosocks -d ${server} -j RETURN
iptables -t nat -A iosocks -d 0.0.0.0/8 -j RETURN
iptables -t nat -A iosocks -d 10.0.0.0/8 -j RETURN
iptables -t nat -A iosocks -d 127.0.0.0/8 -j RETURN
iptables -t nat -A iosocks -d 169.254.0.0/16 -j RETURN
iptables -t nat -A iosocks -d 172.16.0.0/12 -j RETURN
iptables -t nat -A iosocks -d 192.168.0.0/16 -j RETURN
iptables -t nat -A iosocks -d 224.0.0.0/4 -j RETURN
iptables -t nat -A iosocks -d 240.0.0.0/4 -j RETURN
iptables -t nat -A iosocks -p tcp -j REDIRECT --to-ports 1081
iptables -t nat -A OUTPUT -p tcp -j iosocks
iptables -t nat -A PREROUTING -p tcp -j iosocks
from  https://github.com/puxxustc/iosocks

No comments:

Post a Comment