[GH-ISSUE #5376] [Feature]: Displaying Outgoing Connections in the Inbox tab and in subscriptions #3763

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

Originally created by @vrcher on GitHub (Jun 16, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5376

I would like to use Outgoing Connections in my subscription, but there is no way to add it directly there. Currently, the only option is to add any incoming connection and configure routing through the settings panel to the desired outgoing server. This means that the traffic goes through my server.

Describe the solution you'd like

When adding Outgoing Connections or subscriptions, the option to check a box to display that connection in your subscription

Alternatives you've considered

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

Frontend (UI / panel pages), Subscription (share links / Clash / JSON)

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 @vrcher on GitHub (Jun 16, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5376 ### Is your feature request related to a problem? I would like to use Outgoing Connections in my subscription, but there is no way to add it directly there. Currently, the only option is to add any incoming connection and configure routing through the settings panel to the desired outgoing server. This means that the traffic goes through my server. ### Describe the solution you'd like When adding Outgoing Connections or subscriptions, the option to check a box to display that connection in your subscription ### Alternatives you've considered - ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? Frontend (UI / panel pages), Subscription (share links / Clash / JSON) ### Are you willing to help? - [x] I'd like to implement this feature myself and open a PR. - [x] 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 (Jun 16, 2026):

This is a distinct feature from the existing outbound-subscription mechanism and does not exist in the current codebase.

What the current code does (for context)

The OutboundSubscriptionService (internal/web/service/outbound_subscription.go) lets the admin import remote proxy lists and inject them as server-side Xray outbounds — traffic from clients still enters via an inbound, and Xray routes it through one of those outbounds. The client never sees the outbound config.

The client-facing subscription path (internal/sub/service.go, internal/sub/json_service.go) generates proxy links from inbound entries only. There is no code path that reads the panel's outbound objects and converts them to client-consumable share links.

What this request adds

A way to mark one or more outbound entries so they appear directly in a client's subscription output (raw links, Clash YAML, or full JSON config), allowing the client to connect to that outbound server directly rather than routing through the panel's inbound→outbound chain.

Technical scope for an implementation PR

  1. Marking outbounds for export. The outbound template blob in xrayTemplateConfig (a raw JSON field in DB) currently has no "visible to subscription" flag. This would need either a new structured DB column on outbounds, or a convention (e.g. a tag suffix) that the sub service can detect. The UI in frontend/src/lib/xray/outbound-form-adapter.ts and the Outbounds panel form would need a corresponding toggle.

  2. Outbound-to-share-link conversion. internal/sub/json_service.go:93 calls parsedExternalOutbound(link) to convert a share link into an outbound JSON object. The reverse is needed here: take a VLESS/VMess/Trojan/Shadowsocks outbound object and serialize it back to the corresponding URI scheme. No such encoder exists in the current internal/sub/ or internal/util/link/ packages; it would need to be written. Note that direct, block, SOCKS, HTTP proxy, and WireGuard outbounds do not have universally supported client-side URI formats, so the feature would likely cover only VLESS, VMess, Trojan, and Shadowsocks outbounds.

  3. Sub-service integration. SubService.GetSubs(), SubJsonService.GetJson(), and ClashService.GetClash() in internal/sub/ would each need a new code path to append the exported-outbound links alongside the inbound-derived links, scoped to the requesting client's subscription ID (or a separate flag).

  4. Subscription-imported outbounds. For outbounds that originally came from an OutboundSubscription fetch, the original share links are not preserved — only the parsed outbound JSON is stored in LastFetchedOutbounds. Re-exporting them to clients would require re-encoding from JSON, which is the same problem as point 2.

If you plan to open a PR, it would be helpful to include a design comment or draft PR that covers: (a) how the "visible to subscription" flag is stored, (b) which outbound protocols are in scope, and (c) whether the export targets all clients universally or is scoped per-client/per-subscription-ID.

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

<!-- gh-comment-id:4715516438 --> @github-actions[bot] commented on GitHub (Jun 16, 2026): This is a distinct feature from the existing outbound-subscription mechanism and does not exist in the current codebase. **What the current code does (for context)** The `OutboundSubscriptionService` (`internal/web/service/outbound_subscription.go`) lets the admin *import* remote proxy lists and inject them as server-side Xray outbounds — traffic from clients still enters via an inbound, and Xray routes it through one of those outbounds. The client never sees the outbound config. The client-facing subscription path (`internal/sub/service.go`, `internal/sub/json_service.go`) generates proxy links from **inbound** entries only. There is no code path that reads the panel's outbound objects and converts them to client-consumable share links. **What this request adds** A way to mark one or more outbound entries so they appear directly in a client's subscription output (raw links, Clash YAML, or full JSON config), allowing the client to connect to that outbound server directly rather than routing through the panel's inbound→outbound chain. **Technical scope for an implementation PR** 1. **Marking outbounds for export.** The outbound template blob in `xrayTemplateConfig` (a raw JSON field in DB) currently has no "visible to subscription" flag. This would need either a new structured DB column on outbounds, or a convention (e.g. a tag suffix) that the sub service can detect. The UI in `frontend/src/lib/xray/outbound-form-adapter.ts` and the Outbounds panel form would need a corresponding toggle. 2. **Outbound-to-share-link conversion.** `internal/sub/json_service.go:93` calls `parsedExternalOutbound(link)` to convert a share link into an outbound JSON object. The reverse is needed here: take a VLESS/VMess/Trojan/Shadowsocks outbound object and serialize it back to the corresponding URI scheme. No such encoder exists in the current `internal/sub/` or `internal/util/link/` packages; it would need to be written. Note that `direct`, `block`, SOCKS, HTTP proxy, and WireGuard outbounds do not have universally supported client-side URI formats, so the feature would likely cover only VLESS, VMess, Trojan, and Shadowsocks outbounds. 3. **Sub-service integration.** `SubService.GetSubs()`, `SubJsonService.GetJson()`, and `ClashService.GetClash()` in `internal/sub/` would each need a new code path to append the exported-outbound links alongside the inbound-derived links, scoped to the requesting client's subscription ID (or a separate flag). 4. **Subscription-imported outbounds.** For outbounds that originally came from an `OutboundSubscription` fetch, the original share links are not preserved — only the parsed outbound JSON is stored in `LastFetchedOutbounds`. Re-exporting them to clients would require re-encoding from JSON, which is the same problem as point 2. If you plan to open a PR, it would be helpful to include a design comment or draft PR that covers: (a) how the "visible to subscription" flag is stored, (b) which outbound protocols are in scope, and (c) whether the export targets all clients universally or is scoped per-client/per-subscription-ID. *This reply was generated automatically; a maintainer may follow up.*
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#3763
No description provided.