-
Notifications
You must be signed in to change notification settings - Fork 0
Runtime Lifecycle
v2rayroot edited this page Jun 14, 2026
·
1 revision
STOPPED -> STARTING -> RUNNING -> STOPPING -> STOPPED
char *GetStatus(void);Returns an allocated state string. Release it with FreeCString.
char *Start(char *configInput, char *optionsJSON);configInput accepts:
- Complete Xray JSON
- Path to an Xray JSON file
-
vless://,vmess://,trojan://, orss://URI
Basic options:
{
"geositeFile": "/absolute/path/geosite.dat",
"geositePath": "/absolute/path/geosite.dat"
}Return value:
- Null: startup accepted
- Non-null: allocated error text
Startup is asynchronous. Applications may poll status and verify their local proxy port before presenting a connected state.
char *Stop(void);Returns null after a successful stop. When no instance is active, it returns
the allocated string server not running.
- Load library.
- Read version metadata.
- Configure logging.
- Validate configuration.
- Start runtime.
- Poll status and statistics.
- Stop runtime.
- Release all native strings.
- Unload library.
Serialize lifecycle calls in the application even though internal state is mutex protected.