xray/

directory
v0.0.0-...-b380bb8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT

README

Xray

OhMyServer links Xray-core into the Go binary. The module uses the same engine, HTTP API, and UI in both hosts.

  • In OhMyServer, open Xray in the navigation. State lives under <dataDir>/xray; the management API uses the panel's authentication.
  • To run on its own, run make deps from the repository root, then go run ./modules/xray/cmd/xray-go -listen 127.0.0.1:8090 -d ./xray-data. Set XRAY_GO_PASSWORD for HTTP Basic authentication (any username). An address outside loopback requires a password; terminate TLS in front of the management listener if accessing it over a network.

The module starts stopped on a fresh install. Create or edit entries on Inbounds, Outbounds, and Rules; outbound and rule order is editable. Use Configuration to paste a full Xray JSON document or edit settings such as DNS and routing strategy. GeoIP and GeoSite references require the corresponding Xray data files; set XRAY_LOCATION_ASSET for the service to point at their directory.

Saving compiles the draft with Xray's configuration builder. Start Xray or Apply changes on Overview starts the saved draft. Applying a new configuration restarts the embedded core and may interrupt connections. If startup fails, the module attempts to restore the last running configuration. Restarting the host loads the last applied configuration; Stop Xray disables that startup without discarding the draft.

The module serves GET /config, PUT /config, POST /apply, and POST /stop relative to its API base. Writes take the current revision from GET; PUT also takes a config object. A stale revision returns 409. Use separate state directories and data-plane ports for independent hosts.

Directories

Path Synopsis
cmd
xray-go command
Command xray-go serves the Xray module on its own.
Command xray-go serves the Xray module on its own.
Package engine manages one embedded Xray instance and its saved configuration.
Package engine manages one embedded Xray instance and its saved configuration.
Package web exposes the embedded Xray engine as a panel module.
Package web exposes the embedded Xray engine as a panel module.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL