Tunnel Runtime Status Logic
This note documents how tunnel runtime status is derived from the client state file.
Data source
Runtime status reads C:\ProgramData\xp2p\xp2p-client.state.json and uses:
tun_enabledmoderuntime.tun.*runtime.routes.*runtime.socks_readyruntime.last_errorruntime.timestamp
If the file is missing or runtime is empty, the status is Tun: Unknown.
Status derivation
Tunnel readiness
- If
tun_enabled=false(proxy mode): - Ready when
runtime.socks_ready=true - Pending when
runtime.socks_ready=false - If
tun_enabled=true: tun_ready = runtime.tun.readyroutes_ready = runtime.routes.full_applied || runtime.routes.redirect_applied- Ready when both
tun_readyandroutes_readyare true - Pending otherwise
Route label
The status logic uses runtime flags with the current mode:
Proxywhentun_enabled=falseFullwhenruntime.routes.full_applied=trueSplitwhenruntime.routes.redirect_applied=trueTunwhentun_enabled=trueand neither route flag is true
Errors
If runtime.last_error is present, append it to the detail line.
Example strings
Proxy: Ready (SOCKS)Tun: Ready | Routes: FullTun: Pending | Routes: SplitTun: Unknown