Xray Routing Editor is a desktop GUI for editing the routing section of an xray-core configuration file. It is intended for users who want to manage routing rules visually instead of editing JSON or JSONC by hand.
The app follows the official Xray routing model documented by Project X:
In Xray, the routing object contains fields such as:
domainStrategyrulesbalancers
Rules match traffic by attributes such as domain, IP/CIDR, port, source port, inbound tag, user, protocol, and network, then route matching traffic to an outboundTag or balancerTag. Rule order matters: Xray evaluates rules from top to bottom and uses the first effective match. When no rule matches, traffic falls back to the first outbound by default. This editor is built around that behavior.
The app currently helps with:
- opening an existing Xray config file
- extracting known inbound, outbound, balancer, and user tags from the config
- editing routing rules in a structured form
- reordering rules
- previewing routing changes before save
- writing the updated
routingsection back while preserving comments and unrelated JSONC content outside that section
src/main/: Electron main processsrc/preload/: preload bridge exposed aswindow.electronAPIsrc/renderer/: React UI built with Vitesrc/renderer/src/configIO.ts: parsing, validation, serialization, and routing replacement logicexample.json: sample config inputbuild/: app icon assets used for packaging
From the repository root:
npm install
npm run devUseful commands:
npm run dev: start the Electron + Vite development appnpm run build: compile the app intoout/npm run start: preview the built appnpm run dist:linux: create a Linux package withelectron-buildernpm run dist:win: create a Windows package withelectron-builder
The repository includes:
vitestfor unit and integration tests@testing-library/reactfor renderer behaviorplaywrightfor an Electron smoke test
Run them with:
npm test
npm run build
npm run test:e2eMore detail is available in docs/tests.md.
- This app edits routing configuration only; it is not a replacement for the full
xray-coreconfig format. - Packaged app metadata such as product name, version, and icon are defined in
package.json.

