[GH-ISSUE #5118] [Feature]: #3597

Closed
opened 2026-10-31 20:33:35 +07:00 by bsakaguchi · 1 comment
Owner

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

no

Describe the solution you'd like

Is it possible to add the ability to receive config in JSON format? This format would be convenient for Linux, since the xray client service is installed from a package and only has a config.json file.

To import a config from x-ui to a Linux desktop, you have to first transfer it to your smartphone, and then import it as JSON from there. So, if the v2rayTun app has import functionality, maybe there's a library that can be integrated into x-ui and directly retrieve JSON from it?

Alternatives you've considered

I didn't consider alternatives because they are graphical, and Linux is often conveniently managed via SSH, so installing a graphical shell on machines to get a proxy isn't rational.

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 @DoctorCat92 on GitHub (Jun 9, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5118 ### Is your feature request related to a problem? no ### Describe the solution you'd like Is it possible to add the ability to receive config in JSON format? This format would be convenient for Linux, since the xray client service is installed from a package and only has a config.json file. To import a config from x-ui to a Linux desktop, you have to first transfer it to your smartphone, and then import it as JSON from there. So, if the v2rayTun app has import functionality, maybe there's a library that can be integrated into x-ui and directly retrieve JSON from it? ### Alternatives you've considered I didn't consider alternatives because they are graphical, and Linux is often conveniently managed via SSH, so installing a graphical shell on machines to get a proxy isn't rational. ### 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. - [x] I can help test once a PR is open. ### Before submitting - [ ] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:33:35 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 9, 2026):

Good news — the feature you're describing already exists in 3x-ui as the JSON Subscription endpoint. It generates a complete, ready-to-use config.json for xray-core clients, including inbounds (SOCKS5+HTTP on ports 10808/10809), outbounds, DNS, and routing rules. It's exactly what you need to run `xray run -c config.json` on a headless Linux machine.

How to enable it

  1. Open the panel → Settings → Subscription tab.
  2. Toggle Enable JSON Subscription (subJsonEnable) to on.
  3. Save. The default JSON path is /json/ (configurable in the same tab).

How to get your config

Once enabled, each client's JSON subscription URL is shown in the Client Info dialog (the info/QR icon on the inbound). The URL looks like:

http(s)://<your-panel-host>:<sub-port>/json/<subId>

On your Linux desktop:

# Download the config
curl -o ~/.config/xray/config.json "https://<panel>:<port>/json/<subId>"

# Run xray with it
xray run -c ~/.config/xray/config.json

The generated config sets up a local mixed (SOCKS5+HTTP) proxy on port 10808 and an HTTP-only proxy on port 10809, so your applications can use either.

Supported protocols

The JSON generator covers VMess, VLESS, Trojan, Shadowsocks, and Hysteria. WireGuard, SOCKS, and Dokodemo-door inbounds don't produce JSON subscription output.

If you have multiple inbounds linked to the same subId, the endpoint returns an array of configs rather than a single object, so you can pick the one you want or loop over them in a script.

<!-- gh-comment-id:4657691426 --> @github-actions[bot] commented on GitHub (Jun 9, 2026): Good news — the feature you're describing already exists in 3x-ui as the **JSON Subscription** endpoint. It generates a complete, ready-to-use `config.json` for xray-core clients, including inbounds (SOCKS5+HTTP on ports 10808/10809), outbounds, DNS, and routing rules. It's exactly what you need to run \`xray run -c config.json\` on a headless Linux machine. ## How to enable it 1. Open the panel → **Settings** → **Subscription** tab. 2. Toggle **Enable JSON Subscription** (`subJsonEnable`) to **on**. 3. Save. The default JSON path is `/json/` (configurable in the same tab). ## How to get your config Once enabled, each client's JSON subscription URL is shown in the **Client Info** dialog (the info/QR icon on the inbound). The URL looks like: ``` http(s)://<your-panel-host>:<sub-port>/json/<subId> ``` On your Linux desktop: ```bash # Download the config curl -o ~/.config/xray/config.json "https://<panel>:<port>/json/<subId>" # Run xray with it xray run -c ~/.config/xray/config.json ``` The generated config sets up a local `mixed` (SOCKS5+HTTP) proxy on port **10808** and an HTTP-only proxy on port **10809**, so your applications can use either. ## Supported protocols The JSON generator covers **VMess, VLESS, Trojan, Shadowsocks, and Hysteria**. WireGuard, SOCKS, and Dokodemo-door inbounds don't produce JSON subscription output. If you have multiple inbounds linked to the same `subId`, the endpoint returns an array of configs rather than a single object, so you can pick the one you want or loop over them in a script.
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#3597
No description provided.