Validate Xray configurations through instance construction - #153
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TestXrayfrom configuration loading only tonewXrayInstancefollowed byClose, without callingStartor publishing a managed instance.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=1python3 build/main.py androidpython3 build/main.py apple gogo.modandgo.sum.git diff --checkWindows/Linux artifacts and real VPN startup were not tested.