Skip to content

Validate Xray configurations through instance construction - #153

Merged
yiguodev merged 2 commits into
mainfrom
dev-26.9-3
Sep 10, 2026
Merged

yiguodev merged 2 commits into
mainfrom
dev-26.9-3

Conversation

@yiguodev

Copy link
Copy Markdown
Collaborator

Summary

  • Change TestXray from configuration loading only to newXrayInstance followed by Close, without calling Start or publishing a managed instance.
  • Return construction errors, including invalid routing matchers and missing balancers, through the existing error response.
  • Retain the lifecycle lock and rejection of overlap with a managed running instance. Keep API version 3 and the existing request/response contract.
  • Update the English/Chinese API documentation and repository guidance to describe the new validation boundary.

Behavior and limitations

Callers can supply minimal configurations or filter application-managed settings in a disposable validation copy. The library does not apply application-specific filtering or restore process-global side effects. Successful validation confirms instance construction and cleanup, not listener/TUN startup, system permissions, or network connectivity.

Validation

  • go test ./... -count=1
  • python3 build/main.py android
  • python3 build/main.py apple go
  • Verified that builds restored go.mod and go.sum.
  • Regression coverage verifies constructor-only failures, occupied listener ports, no TUN startup, and unchanged Invoke response semantics.
  • git diff --check

Windows/Linux artifacts and real VPN startup were not tested.

Copilot AI lite review requested due to automatic review settings September 10, 2026 04:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 10, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yiguodev
yiguodev merged commit 5bc823f into main Sep 10, 2026
3 checks passed
@yiguodev
yiguodev deleted the dev-26.9-3 branch September 10, 2026 07:50
wejg pushed a commit to wejg/libXray that referenced this pull request Sep 24, 2026
… of https://github.com/XTLS/libXray

* 'main' of https://github.com/wejg/libXray:

* 'main' of https://github.com/XTLS/libXray:
  feat: allow excluding reserved ports from allocation (XTLS#157)
  Restore Matt Pocock skills configuration and documentation (XTLS#156)
  Complete share-link fields and remove legacy VMess QR support (XTLS#155)
  feat: add an optional desktop Core error output file (XTLS#154)
  Validate Xray configurations through instance construction (XTLS#153)
  Update Xray-core to v26.9.9 (XTLS#152)
  refactor: remove runtime accounting and simplify share responses (XTLS#151)
  Add managed runtime accounting and probe APIs (XTLS#150)
  Restore protected desktop DNS resolver (XTLS#148)
  Return validated outbound-only JSON from share conversion (XTLS#147)
  Add Tools .go (XTLS#146)
  Document single Go runtime limitation (XTLS#144)
  Add age-encrypted subscriptions and JSON-based Xray APIs (XTLS#143)
  Fix Windows ARM64 build toolchain (XTLS#142)
  Add concurrent batch ping and improve runtime safety (XTLS#141)
  Validate imported outbounds with Xray-core (XTLS#140)
  Add Android VPN-aware DNS resolver (XTLS#139)
  Update native platform builds (XTLS#138)

# Conflicts:
#	README.md
#	go.mod
#	go.sum
#	invoke.go
#	invoke_model.go
#	invoke_test.go
#	memory/memory_ios.go
#	readme/README.zh_CN.md
#	xray/ping.go
#	xray/xray.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants