ChaiByte / CF-Tunnel-Transparent-Proxy

Demo: Proxy to build stable connection with Cloudflare Tunnel
13 stars 0 forks source link

Question about replace `iptables` with `proxychains4` #1

Open yuantuo666 opened 1 month ago

yuantuo666 commented 1 month ago

In file local/iptable.sh, it actually redirects TCP requests to local proxy server. I am wondering if this will work with tools like proxychains4. Since in some situation, we do not have root privilege to change iptables setting, where proxychains4 might work.

ChaiByte commented 1 month ago

Tools like proxychains4 might be a viable alternative. I have not tested this way yet. By configuring xray to listen on a SOCKS protocol for its inbound connections instead of using a transparent proxy:

Change inbounds rule in local/config.json:

"inbounds": [
    {
        "port": 12306,
        "protocol": "socks",
        "settings": {
            "auth": "noauth",
            "udp": true
        }
    }

More details could be found in xray-core documents.

Your proxychains.conf should be configured like:

socks5 127.0.0.1 12306   # xray's protocol provide authorization

# Or directly connect to the forward proxy server, socks provide authorization
# This approach is suitable if you have a side router or other kinds of proxy service
socks5 123.123.123.123 12306 user password

But I recommend filtering the requests to be forwarded based on the target IP range, otherwise it may lead to unintended behavior.