Skip to content

Instantly share code, notes, and snippets.

@kepocnhh
Created May 1, 2026 12:01
Show Gist options
  • Select an option

  • Save kepocnhh/0bc2929a4f7d3347e6c7fc24cbdf3153 to your computer and use it in GitHub Desktop.

Select an option

Save kepocnhh/0bc2929a4f7d3347e6c7fc24cbdf3153 to your computer and use it in GitHub Desktop.
xray.service
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
User=johndoe
Type=simple
WorkingDirectory=/home/johndoe
ExecStart=/home/johndoe/.local/bin/xray run -c /home/johndoe/.config/xray/config.json
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
Restart=no
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment