This is a simple script that will route all traffic through xray using tun2socks tun adapter
- install xray using command " bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install "
- clone the repo into any directory ( git clone https://github.com/iamtrazy/xray-tun2socks )
- create a user named tun2socks - ( sudo useradd -m tun2socks )
- go to the directory xray-tun2socks
- edit the config.json file and paste your xray-client configuration ( do-not use dns name , instead use VPS ip address )
- set 10808 as socks5 inbound port in xray config
- run the tunnel.sh file ( sudo ./tunnel.sh )
- you can stop the script anytime by pressing ctrl+c