Skip to content

Spider84/hev-socks5-tunnel

 
 

Repository files navigation

HevSocks5Tunnel

status

A tunnel over Socks5 proxy.

Features

  • IPv4/IPv6. (dual stack)
  • Redirect TCP connections.
  • Redirect UDP packets. (UDP over TCP see server)

How to Build

Linux:

git clone --recursive git://github.com/heiher/hev-socks5-tunnel
cd hev-socks5-tunnel
make

Android:

mkdir hev-socks5-tunnel
cd hev-socks5-tunnel
git clone --recursive git://github.com/heiher/hev-socks5-tunnel jni
ndk-build

How to Use

Config

tunnel:
  # Interface name
  name: tun0
  # Interface MTU
  mtu: 10496
  # IPv4 address
  ipv4:
    address: 10.0.0.2
    gateway: 10.0.0.1
    prefix: 30
  # IPv6 address
  ipv6:
    address: 'fc00::2'
    gateway: 'fc00::1'
    prefix: 126

socks5:
  # Socks5 server port
  port: 1080
  # Socks5 server address (ipv4/ipv6)
  address: 127.0.0.1

#misc:
   # task stack size (bytes)
#  task-stack-size: 20480
   # connect timeout (ms)
#  connect-timeout: 5000
   # read-write timeout (ms)
#  read-write-timeout: 60000
   # stdout, stderr or file-path
#  log-file: stderr
   # debug, info, warn or error
#  log-level: warn
   # If present, run as a daemon with this pid file
#  pid-file: /run/hev-socks5-tunnel.pid
   # If present, set rlimit nofile; else use default value
#  limit-nofile: 1024

Run

bin/hev-socks5-tunnel conf/main.yml

# Bypass upstream socks5 server
sudo ip route add SOCKS5_SERVER dev DEFAULT_IFACE metric 10
sudo ip -6 route add SOCKS5_SERVER dev DEFAULT_IFACE metric 10

# Route others
sudo ip route add default dev tun0 metric 20
sudo ip -6 route add default dev tun0 metric 20

Authors

License

LGPL

About

Tunnel over Socks5 proxy (tun2socks)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 92.7%
  • Makefile 7.3%