Skip to content

Ali-Flt/xray-tproxy

Repository files navigation

xray-tproxy

A transparent proxy based on the Tproxy documentation in Project X here.

How to use

  1. Install dependencies:
  • xray in /usr/bin/xray
  • nft (Netfliter) in /usr/sbin/nft
  • ip in /usr/sbin/ip
  1. Create config.json based on config.json.example and replace the first outbound connection with your own. Also make sure to change all instances of your.domain.name, your_uuid, put.your.ipv4.address, ... elsewhere. You can export your outbound connection using xray clients such as nekoray. Make sure to keep this section in the outbound settings:
"streamSettings": {
    "sockopt": {
        "mark": 2
        },
    ...
}
  1. Copy config.json to /etc/xray/:

    sudo mkdir /etc/xray/

    sudo cp config.json /etc/xray/config.json

  2. Copy xray.service to /usr/lib/systemd/system/:

    sudo cp xray.service /usr/lib/systemd/system/xray.service

  3. Copy the nftables.conf to /etc:

    sudo cp nftables.conf /etc/nftables.conf

  4. Copy nftables.service to /lib/systemd/system/:

    sudo cp nftables.service /lib/systemd/system/nftables.service

  5. Reload systemctl:

    sudo systemctl daemon-reload

  6. Start and enable Xray service:

    sudo systemctl start xray && sudo systemctl enable xray

  7. Start and enable nftables service:

    sudo systemctl start nftables.service && sudo systemctl enable nftables.service

Steps 3 to 9 can be done automatically using sudo ./xray-tproxy.sh

Donations

Consider buying me a coffee if this helped you.

"Buy Me A Coffee"

About

A transparent proxy based on Project X

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages