Skip to content

JSON to Share URI

v2rayroot edited this page Jun 14, 2026 · 1 revision

JSON to Share URI

JSONToConfigString

char *JSONToConfigString(char *configJSON);

Converts an eligible Xray outbound into:

  • vless://
  • vmess://
  • trojan://
  • ss://

Outbound Selection

The converter chooses:

  1. Outbound tagged Proxy
  2. First outbound not tagged Direct or Reject
  3. First outbound as a fallback

Failure

Unsupported, invalid, or incomplete JSON returns an allocated empty string.

Limitations

Conversion can be lossy because not every Xray JSON field has an equivalent share-URI parameter. Preserve original JSON when exact round trips matter.

If streamSettings is absent, conversion assumes TCP with no security.

Clone this wiki locally