share-links.mdx 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ---
  2. title: Share Links
  3. description: 3x-ui share-link formats (vless, vmess, trojan, ss, hysteria2, mtproto), the remark template variables, and an in-browser link inspector.
  4. icon: Link
  5. ---
  6. 3x-ui generates a **share link** (and QR code) for each client. Client apps such
  7. as v2rayNG, Hiddify, and Mihomo import these links to configure themselves.
  8. ## Link formats
  9. | Scheme | Shape |
  10. | -------------- | --------------------------------------------------------------- |
  11. | `vless://` | `vless://<uuid>@<host>:<port>?<params>#<remark>` |
  12. | `vmess://` | `vmess://<base64-json>` (a base64-encoded JSON object) |
  13. | `trojan://` | `trojan://<password>@<host>:<port>?<params>#<remark>` |
  14. | `ss://` | `ss://<userinfo>@<host>:<port>?<params>#<remark>` (SIP002; Shadowsocks-2022 uses percent-encoded userinfo) |
  15. | `hysteria2://` | `hysteria2://<auth>@<host>:<port>?<params>#<remark>` |
  16. | `tg://proxy` | `tg://proxy?server=…&port=…&secret=…` (MTProto) |
  17. | `tuic://` | `tuic://<uuid>:<password>@<host>:<port>?<params>#<remark>` (TUIC v5) |
  18. The query parameters carry the transport and security settings — `security`,
  19. `sni`, `fp`, `pbk`, `sid`, `spx`, `flow`, `type`, `path`, `host`, `alpn`, and
  20. more.
  21. ## Inspect a link
  22. Paste any share link to decode every field. Parsing happens **entirely in your
  23. browser** — the link is never sent over the network.
  24. <ShareLinkInspector />
  25. <Callout type="warn">
  26. Share links contain everything needed to connect as a client, including the
  27. client's credential. Treat them like passwords.
  28. </Callout>
  29. ## Remark template variables
  30. The text after `#` in each link (the **remark**) is generated from a template
  31. you control in Panel Settings (`remarkTemplate`). The default is:
  32. ```text
  33. {{INBOUND}}-{{EMAIL}}|📊{{TRAFFIC_LEFT}}|⏳{{DAYS_LEFT}}D
  34. ```
  35. Tokens use `{{UPPER_CASE}}` syntax. The template is split on `|` into segments;
  36. a segment whose only value is the unlimited marker `∞` (for `TRAFFIC_LEFT`,
  37. `TRAFFIC_TOTAL`, `DAYS_LEFT`, or `TIME_LEFT`) is dropped, so unlimited clients
  38. don't show empty decorations.
  39. ### Available tokens
  40. | Token | Value |
  41. | ----- | ----- |
  42. | `{{EMAIL}}` / `{{USERNAME}}` | Client email (identifier) |
  43. | `{{INBOUND}}` | Inbound remark |
  44. | `{{HOST}}` | Host-row remark (managed hosts) |
  45. | `{{ID}}` / `{{SHORT_ID}}` | Client UUID / its first 8 chars |
  46. | `{{TELEGRAM_ID}}` · `{{SUB_ID}}` · `{{COMMENT}}` | Telegram ID, subscription ID, comment |
  47. | `{{STATUS}}` / `{{STATUS_EMOJI}}` | `active`/`expired`/`depleted`/`disabled` (or ✅⏳🚫) |
  48. | `{{DAYS_LEFT}}` / `{{TIME_LEFT}}` | Days, or `Xd Xh Xm`, remaining (`∞` if unlimited) |
  49. | `{{EXPIRE_DATE}}` / `{{JALALI_EXPIRE_DATE}}` / `{{EXPIRE_UNIX}}` | Expiry as Gregorian / Jalali date / Unix seconds |
  50. | `{{CREATED_UNIX}}` | Creation time (Unix seconds) |
  51. | `{{TRAFFIC_USED}}` / `{{TRAFFIC_LEFT}}` / `{{TRAFFIC_TOTAL}}` | Human-readable usage (`∞` if unlimited) |
  52. | `{{TRAFFIC_USED_BYTES}}` / `{{TRAFFIC_LEFT_BYTES}}` / `{{TRAFFIC_TOTAL_BYTES}}` | Same, in bytes |
  53. | `{{UP}}` / `{{DOWN}}` | Upload / download (human-readable) |
  54. | `{{RESET_DAYS}}` · `{{USAGE_PERCENTAGE}}` | Reset period (days) · used percent |
  55. | `{{PROTOCOL}}` / `{{TRANSPORT}}` / `{{SECURITY}}` | e.g. `VLESS` / `ws` / `REALITY` |
  56. <Callout type="info">
  57. Usage tokens (traffic, days, status) appear in the subscription **body** but
  58. are stripped from the display/QR view, so a shared QR doesn't leak a client's
  59. remaining quota. Date tokens follow the `datepicker` setting (Gregorian or
  60. Jalali).
  61. </Callout>
  62. ## Related
  63. <Cards>
  64. <Card title="REALITY" href="/docs/config/reality" description="Generate a VLESS + REALITY config and link." />
  65. <Card title="Subscription" href="/docs/config/subscription" description="Serve all of a client's links from one URL." />
  66. </Cards>