cybozu-go / transocks

Transparent SOCKS5 / HTTP proxy in Go
MIT License
467 stars 61 forks source link

Redirect TCP connections transparently from gateway to SOCKS5/HTTP proxy servers in the internal network. #25

Open hongyi-zhao opened 3 years ago

hongyi-zhao commented 3 years ago

Hi,

See my network topology shown below:

werner@X10DAi-01:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    100    0        0 enp4s0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.18.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-4c1ca7caab31
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 enp4s0
192.168.0.1     0.0.0.0         255.255.255.255 UH    100    0        0 enp4s0

werner@X10DAi-01:~$ ip a show enp4s0 
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 3c:ec:ef:00:f1:28 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.3/24 brd 192.168.0.255 scope global dynamic enp4s0
       valid_lft 6713sec preferred_lft 6713sec
    inet6 fe80::3eec:efff:fe00:f128/64 scope link 
       valid_lft forever preferred_lft forever

I've socks5/HTTP servers running on 192.168.0.3:18888/8080 accordingly/separately and I want to let these servers can be accessed with the same ports on the gateway i.e., 192.168.0.1:18888/8080 respectively, from external network. Can this function be implemented based on transocks?

Regards, HY