Skip to content

normalize CUSTOM_OUTBOUND and remove it from ComplexTypes - #6519

Open
nix-julia wants to merge 1 commit into
2dust:masterfrom
nix-julia:normalize-custom-outbound
Open

nix-julia wants to merge 1 commit into
2dust:masterfrom
nix-julia:normalize-custom-outbound

Conversation

@nix-julia

Copy link
Copy Markdown
Contributor

CUSTOM_OUTBOUND behaves like a regular outbound type, except it does not support importing or exporting as a link.

@2dust

2dust commented Nov 25, 2026

Copy link
Copy Markdown
Owner

你可能把 CUSTOM_OUTBOUND 理解简单了。
CUSTOM_OUTBOUND 可能是一个数组,并不是一个 outbound

@nix-julia

Copy link
Copy Markdown
Contributor Author

Thanks for the review. From what I can see in the current implementation, CUSTOM_OUTBOUND is handled as a single outbound object: CustomOutboundFmt.parse() parses one V2rayConfig.OutboundBean, the raw config is stored as that single outbound JSON, and CoreConfigManager.convertProfile2Outbound() reads it back as one OutboundBean. The import path also accepts a single outbound-shaped JSON (!server.contains("outbounds") && server.contains("protocol")).

It sounds like I may be missing a case where ‍‍CUSTOM_OUTBOUND can be an array, or contain multiple outbounds. Could you point me to an example format or the import/creation flow for that case? I’d be happy to update the PR to handle it properly.

@nix-julia
nix-julia marked this pull request as draft November 25, 2026 14:14
@2dust

2dust commented Nov 26, 2026

Copy link
Copy Markdown
Owner

2dust/v2rayN#10578

可能后面会支持

@nix-julia

Copy link
Copy Markdown
Contributor Author

Thanks for the reference. If support for multiple outbounds is planned, one possible import approach would be to create a CUSTOM_OUTBOUND for each outbound in the array, then construct a proxy chain from their dialerProxy relationships when those relationships form a valid chain. If they don’t, we could preserve the array order as the chain order. This would let us reuse the existing logic while keeping the change backward-compatible. Would that fit the direction you have in mind?

@nix-julia
nix-julia force-pushed the normalize-custom-outbound branch from 10d38d1 to b7c59b3 Compare November 26, 2026 14:39
@nix-julia
nix-julia marked this pull request as ready for review November 27, 2026 08:48
@nix-julia
nix-julia marked this pull request as draft November 27, 2026 08:49
@nix-julia
nix-julia force-pushed the normalize-custom-outbound branch from b7c59b3 to d62b97a Compare November 27, 2026 09:00
@nix-julia
nix-julia marked this pull request as ready for review November 27, 2026 09:02
@nix-julia
nix-julia force-pushed the normalize-custom-outbound branch 2 times, most recently from d33f83c to 4ef13d7 Compare November 28, 2026 06:33
@nix-julia
nix-julia force-pushed the normalize-custom-outbound branch from 4ef13d7 to 638b5e5 Compare November 28, 2026 06:35
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