explaingit

servertechnologies/cascade-for-x-ray

Analysis updated 2026-05-18

14ShellAudience · ops devopsComplexity · 4/5LicenseSetup · hard

TLDR

Cascade-for-x-ray is a Bash script that automates configuring a cascaded outbound proxy connection for a self-hosted Xray-core server from a single VLESS link.

Mindmap

mindmap
  root((Cascade for x-ray))
    What it does
      Parses VLESS link
      Rewrites Xray config
      Sets routing rules
    Tech stack
      Bash
      Xray-core
      jq
      systemd
    Use cases
      Route by geo rules
      Block ad domains
      Auto refresh geo data
    Audience
      Server administrators

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Automatically configure a cascaded outbound connection on an Xray-core server from one VLESS link.

USE CASE 2

Route traffic to local-zone domains directly while tunneling everything else through the outbound server.

USE CASE 3

Schedule a cron job that keeps the geo-database routing files refreshed automatically.

What is it built with?

BashXray-corejqsystemdPython

How does it compare?

servertechnologies/cascade-for-x-rayalhajashafffy/shellsafebrettkinny/tower-dashboard
Stars141414
LanguageShellShellShell
Setup difficultyhardeasymoderate
Complexity4/52/52/5
Audienceops devopsops devopsops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires an existing Xray-core install plus jq, wget, python3, and systemd on the server.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Cascade-for-x-ray is a Bash script that automates the setup of a cascaded outbound connection on a server running Xray-core, a proxy tool commonly used to route internet traffic around network restrictions. It is designed to pair with the author's separate Xray installation script, and it works by taking a single VLESS connection link as input and doing the rest automatically. When you run the script and paste a VLESS link, it parses the link to extract the server address, port, user ID, transport type, and REALITY encryption parameters. It then rewrites the Xray config.json file with updated routing rules and outbound connection settings. A backup of the previous config is saved before any changes are made, so you can restore it manually if something goes wrong. The routing rules it sets up send traffic differently depending on the destination. Requests to Russian-zone domains and IP addresses (loaded from geo-database files) go directly through the server without proxying. Requests to known advertising domains are blocked. Everything else is tunneled through the outbound server specified in your VLESS link. The geo-database files themselves are downloaded fresh from a third-party repository during setup, replacing any older files. Two transport modes are supported, depending on what the VLESS link specifies: VLESS over XHTTP with REALITY encryption and multiplexing, or VLESS over TCP with REALITY and the xtls-rprx-vision flow. The script detects which to use from the type parameter in the link. The script also creates a helper script at a fixed path on the server that can be scheduled with cron to refresh the geo-database files periodically, so routing stays current without a full reconfiguration. After writing the new config, it restarts the Xray service via systemd. Dependencies are Xray-core, jq, wget, python3, and systemd, all of which are standard on Ubuntu.

Copy-paste prompts

Prompt 1
Explain what information the script extracts from a VLESS link before rewriting Xray's config.json.
Prompt 2
Set up a cron job using the helper script this tool creates to refresh geo-database files weekly.
Prompt 3
What is the difference between the VLESS over XHTTP and VLESS over TCP transport modes this script supports?
Prompt 4
List the dependencies I need installed on Ubuntu before running this script.

Frequently asked questions

What is cascade-for-x-ray?

Cascade-for-x-ray is a Bash script that automates configuring a cascaded outbound proxy connection for a self-hosted Xray-core server from a single VLESS link.

What language is cascade-for-x-ray written in?

Mainly Shell. The stack also includes Bash, Xray-core, jq.

What license does cascade-for-x-ray use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is cascade-for-x-ray to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is cascade-for-x-ray for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.