feat: support JSON balancer configs with individual node tracking#145
Open
AirP0WeR wants to merge 2 commits intokutovoys:mainfrom
Open
feat: support JSON balancer configs with individual node tracking#145AirP0WeR wants to merge 2 commits intokutovoys:mainfrom
AirP0WeR wants to merge 2 commits intokutovoys:mainfrom
Conversation
When a subscription returns JSON configs with multiple proxy outbounds per entry (Remnawave balancers), each node now gets a unique name in the format "remarks | server_address" instead of all sharing the same remarks string. This fixes status tracking for individual nodes within balancer groups. Also adds --subscription-user-agent and --subscription-header options to allow custom HTTP headers when fetching subscriptions, which is needed to receive JSON format from servers that return different content based on User-Agent.
Single flag that sends app-like HTTP headers to get JSON configs with full balancer details from Remnawave panels, instead of requiring users to manually configure User-Agent and X-Hwid headers.
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
Adds support for Remnawave JSON balancer configurations, allowing xray-checker to monitor each individual node within a balancer group separately.
Problem
When a subscription uses Remnawave JSON balancers, xray-checker currently shows balancer groups (e.g. "Germany") as a single entry with a virtual host like
auto-de:1234. There is no way to track the availability of individual servers within the balancer — if one of three nodes goes down, the checker still shows the group as one item.Solution
1. Unique names for nodes within balancer groups
When a JSON config has multiple proxy outbounds under one
remarks, each node now gets a unique name:Single-outbound configs keep the original
remarksas the name (no change in behavior).2.
SUBSCRIPTION_JSON_FORMATflagRemnawave panels return different response formats depending on the client's HTTP headers. The default
Xray-CheckerUser-Agent receives base64 share links where balancers are collapsed into virtual hosts. The newSUBSCRIPTION_JSON_FORMAT=trueenv var sends app-like headers so the panel returns full JSON configs with all outbounds.3. Custom HTTP headers (advanced)
For full control, two additional options allow overriding request headers:
SUBSCRIPTION_USER_AGENT— custom User-AgentSUBSCRIPTION_HEADERS— arbitrary headers (Key:Valueformat)Changed files
config/config.go— three new config options (JSONFormat,UserAgent,Headers)subscription/parser.go— unique naming logic for multi-outbound JSON configs + custom header support infetchURLContentBefore / After
SUBSCRIPTION_JSON_FORMAT=true)auto-de:1234de-01,de-02,de-03Backward compatibility
Fully backward-compatible. Without
SUBSCRIPTION_JSON_FORMAT=true, behavior is identical to the current version.