[GH-ISSUE #6427] [Feature]: New open source client support - OneXRAY #4353

Open
opened 2026-10-31 20:39:03 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ilya-practicum on GitHub (Sep 6, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6427

Have found a new xray client - https://github.com/OneXray/OneXray
It is open source, multiplatform, supports routing profiles and subscription encryption. Looks promising. It has different routing profile and config importing. Hope you may check it and add subcription support for it in 3xui

Describe the solution you'd like

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @ilya-practicum on GitHub (Sep 6, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6427 ### Is your feature request related to a problem? Have found a new xray client - https://github.com/OneXray/OneXray It is open source, multiplatform, supports routing profiles and subscription encryption. Looks promising. It has different routing profile and config importing. Hope you may check it and add subcription support for it in 3xui ### Describe the solution you'd like - ### Alternatives you've considered _No response_ ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? _No response_ ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 6, 2026):

Thanks for the pointer. The short answer: 3x-ui has no per-client code path in its subscription server at all — the output format is chosen by URL path, not by which app is asking — so if OneXray imports standard share links or an Xray JSON config, it already works today with the subscription URLs you have, and there is nothing to add. To turn this into something actionable we need to know what OneXray specifically cannot accept.

What the panel serves today

The format is picked by path (docs/config/subscription: "The format is chosen by path, each with its own enable toggle"):

Format Path setting Body
Raw links subPath newline-joined vless:// / vmess:// / trojan:// / ss:// / hy2://, base64 when subEncrypt is on
Xray JSON subJsonPath (subJsonEnable) full Xray client config(s)
Clash / Mihomo subClashPath (subClashEnable) YAML profile

Only enabled VLESS, VMess, Trojan, Shadowsocks and Hysteria2 inbounds appear in a subscription.

The one client-aware knob is already user-configurable. If OneXray sends a distinctive User-Agent and you want it to get the Clash or JSON body from the base subscription path, that is a settings change, not a code change — internal/sub/controller.go:465:

func shouldAutoServeFormat(autoDetect, formatEnabled, wantsHTML bool, userAgent string, userAgentRegex *regexp.Regexp) bool {
	if !autoDetect || !formatEnabled || wantsHTML || userAgentRegex == nil {
		return false
	}
	return userAgentRegex.MatchString(userAgent)
}

Enable subClashAutoDetect / subJsonAutoDetect (both default "false", internal/web/service/setting.go:88 and :91) and set subClashUserAgentRegex / subJsonUserAgentRegex to a pattern that matches OneXray. The built-in Clash default is (?i)(clash|mihomo) (internal/web/service/setting.go:37); a value you set replaces it.

On "subscription encryption" — be aware that the panel's subEncrypt setting is not encryption. It is plain base64, internal/sub/controller.go:439-443:

if a.subEncrypt {
	c.String(200, base64.StdEncoding.EncodeToString([]byte(result.String())))
}

There is no encrypted-subscription support in the tree (no age or equivalent — grepping internal/ and go.mod for filippo.io/age / age-secret-key returns nothing). If that is the part of OneXray you want, it overlaps with the already-open #6364 (age-encrypted Clash output) and #6363 — related, not duplicates of this.

What would make this actionable (the form's "Describe the solution you'd like", "Concrete use case" and "Which parts of the panel would this affect?" were left blank, so this is the gap):

  1. Which of the three URLs above did you try in OneXray, and what did it do — refuse the body, import zero configs, or import them with fields wrong? The exact error text, not a screenshot.
  2. What format does OneXray document for subscriptions that the panel does not already emit — its own JSON schema, sing-box, something else? A link to that part of its docs is enough.
  3. The User-Agent OneXray sends when fetching a subscription, if you can see it in the sub server log.

Note for transparency: this environment has no outbound network access beyond this repository, so I could not read the OneXray repository myself — everything above is from the 3x-ui source. Also worth knowing for whoever picks this up: link and subscription generation is implemented three times independently (internal/util/link/ + internal/sub/ in Go, frontend/src/lib/xray/, and docs/lib/xray/), so a genuinely new output format is a change in all three, not one.

Keeping this open and labelled clarification needed so it comes back around once there is a concrete gap to point at.

Verdict: Feature request

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:5560035871 --> @github-actions[bot] commented on GitHub (Sep 6, 2026): Thanks for the pointer. The short answer: 3x-ui has **no per-client code path in its subscription server at all** — the output format is chosen by URL path, not by which app is asking — so if OneXray imports standard share links or an Xray JSON config, it already works today with the subscription URLs you have, and there is nothing to add. To turn this into something actionable we need to know what OneXray specifically cannot accept. **What the panel serves today** The format is picked by path ([`docs/config/subscription`](https://github.com/MHSanaei/3x-ui/blob/main/docs/content/docs/en/config/subscription.mdx): "The **format is chosen by path**, each with its own enable toggle"): | Format | Path setting | Body | | --- | --- | --- | | Raw links | `subPath` | newline-joined `vless://` / `vmess://` / `trojan://` / `ss://` / `hy2://`, base64 when `subEncrypt` is on | | Xray JSON | `subJsonPath` (`subJsonEnable`) | full Xray client config(s) | | Clash / Mihomo | `subClashPath` (`subClashEnable`) | YAML profile | Only enabled **VLESS, VMess, Trojan, Shadowsocks and Hysteria2** inbounds appear in a subscription. **The one client-aware knob is already user-configurable.** If OneXray sends a distinctive `User-Agent` and you want it to get the Clash or JSON body from the base subscription path, that is a settings change, not a code change — `internal/sub/controller.go:465`: ```go func shouldAutoServeFormat(autoDetect, formatEnabled, wantsHTML bool, userAgent string, userAgentRegex *regexp.Regexp) bool { if !autoDetect || !formatEnabled || wantsHTML || userAgentRegex == nil { return false } return userAgentRegex.MatchString(userAgent) } ``` Enable `subClashAutoDetect` / `subJsonAutoDetect` (both default `"false"`, `internal/web/service/setting.go:88` and `:91`) and set `subClashUserAgentRegex` / `subJsonUserAgentRegex` to a pattern that matches OneXray. The built-in Clash default is `(?i)(clash|mihomo)` (`internal/web/service/setting.go:37`); a value you set replaces it. **On "subscription encryption"** — be aware that the panel's `subEncrypt` setting is *not* encryption. It is plain base64, `internal/sub/controller.go:439-443`: ```go if a.subEncrypt { c.String(200, base64.StdEncoding.EncodeToString([]byte(result.String()))) } ``` There is no encrypted-subscription support in the tree (no `age` or equivalent — grepping `internal/` and `go.mod` for `filippo.io/age` / `age-secret-key` returns nothing). If that is the part of OneXray you want, it overlaps with the already-open #6364 (age-encrypted Clash output) and #6363 — related, not duplicates of this. **What would make this actionable** (the form's "Describe the solution you'd like", "Concrete use case" and "Which parts of the panel would this affect?" were left blank, so this is the gap): 1. Which of the three URLs above did you try in OneXray, and what did it do — refuse the body, import zero configs, or import them with fields wrong? The exact error text, not a screenshot. 2. What format does OneXray document for subscriptions that the panel does not already emit — its own JSON schema, sing-box, something else? A link to that part of its docs is enough. 3. The `User-Agent` OneXray sends when fetching a subscription, if you can see it in the sub server log. Note for transparency: this environment has no outbound network access beyond this repository, so I could not read the OneXray repository myself — everything above is from the 3x-ui source. Also worth knowing for whoever picks this up: link and subscription generation is implemented three times independently (`internal/util/link/` + `internal/sub/` in Go, `frontend/src/lib/xray/`, and `docs/lib/xray/`), so a genuinely new output format is a change in all three, not one. Keeping this open and labelled `clarification needed` so it comes back around once there is a concrete gap to point at. Verdict: Feature request *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4353
No description provided.