Open yuantuo666 opened 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.
In file
local/iptable.sh
, it actually redirects TCP requests to local proxy server. I am wondering if this will work with tools likeproxychains4
. Since in some situation, we do not have root privilege to changeiptables
setting, whereproxychains4
might work.