Add xraycore-compatible probing and policy-group warm-start#201
Open
eliotcougar wants to merge 1 commit into
Open
Add xraycore-compatible probing and policy-group warm-start#201eliotcougar wants to merge 1 commit into
eliotcougar wants to merge 1 commit into
Conversation
Recreate Xray safely across Android underlay changes, preserve policy routes through an acknowledged warm handoff, and provide progressive grouped outbound probes using only the existing upstream observatory and router APIs.
This was referenced Jul 14, 2026
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
This PR adds Android network-switch recovery, policy-group warm starts, and low-overhead bulk outbound probing without requiring any new xray-core functionality.
It is a more limited alternative implementation of #200 that doesn't require changes to xray-core. It uses the existing xray-core lifecycle, router override,
BurstObservatory.Check,GetObservation, and balancer principle-target APIs. Scheduled Observatory behavior remains unchanged.Network-switch recovery
Policy-group warm start
A known previously successful policy-group outbound can be applied as a router override while the replacement Observatory gathers fresh measurements.
The warm-to-observed transition is an acknowledged handoff:
OnBalancerTargetChangedreports it to the embedder.A nonzero callback result retains the warm route and retries the notification. Override inspection or release failures are also retried.
If Observatory is slow or never produces a viable target, the known warm route remains active instead of leaving the balancer without a usable outbound.
Progressive bulk probing
The single-use
OutboundProbeControlleris intended for a short-lived dedicated process and supports:ProbeOutboundsremains available as the flat compatibility API.ProbeOutboundGroupspreserves higher-level configuration boundaries, allowing v2rayNG’s True delay concurrency setting to retain its original per-profile meaning.Why this belongs in AndroidLib
The current v2rayN method of bulk probing, apparently vilolates the intended workflow where only one xray core should be run in a single process. Running temporary xray cores in the same process as the main core can corrupt the main core.
Running one temporary native core per outbound is expensive for Android and other constrained embedders. This adapter provides finite, reliable bulk probing through one disposable process while depending only on xray-core’s existing public behavior.
Verification
go test .go test -race .with the workspace MinGW-w64 race toolchain