-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration Validation
v2rayroot edited this page Jun 14, 2026
·
1 revision
char *ValidateConfig(char *configInput, char *optionsJSON);The accepted input forms match Start: JSON text, JSON file path, or supported
share URI.
Success:
{"result":"valid"}Failure:
{"error":"config validation failed: ..."}Always parse the response as JSON and check for error. Do not compare full
error strings because upstream Xray details can change.
The library:
- Loads or parses the input.
- Migrates legacy
dnsConfigtodns. - Adds missing common defaults.
- Validates required outbound fields.
- Asks Xray-core to load the finalized JSON.
Validation does not start a persistent runtime.
Run validation:
- Before every user-requested connection
- After editing configuration
- After importing a URI
- During application migrations
Treat imported configuration as untrusted data.