Generates a VLess share link in the standard URI format.
Format: vless://{uuid}@{address}:{port}?{params}#{name}
Compatible with: v2rayNG, NekoBox, Shadowrocket.
Node IP or hostname
Node port
Transport network (grpc, tcp, ws, etc.)
Transport security ("tls" or "none")
Optional display name shown in the app (default: "sentinel-js-sdk")
vless:// share link string
Generates a VMess share link in the standard v2rayNG format.
Format: vmess:// + base64(JSON config)
Compatible with: v2rayNG, NekoBox, Shadowrocket, Quantumult X.
Node IP or hostname
Node port
Transport network (grpc, tcp, ws, etc.)
Transport security ("tls" or "none")
Optional display name shown in the app (default: "sentinel-js-sdk")
vmess:// share link string
Starts the v2ray process with the current configuration.
The process is kept as this.child for later termination via disconnect().
Optional configFile: stringOptional path to an existing config JSON file. If omitted, writes the current config to a temp file first.
The PID of the spawned v2ray process, or undefined if spawn failed.
Parses the JSON response from the node handshake and builds the v2ray configuration. Replaces the old 7-byte binary buffer parsing.
Picks the first available metadata entry. If multiple are present (the node supports multiple transports), the first is used — you can extend this to let the caller choose.
Parsed result.data from the handshake response
result.addrs from the handshake response (public IPs of the node)
const raw: V2RayHandshakeData = JSON.parse(
Buffer.from(result.data, 'base64').toString('utf8')
);
await v2ray.parseConfig(raw, result.addrs);
Prints QR codes for all share links to the terminal.
Each QR code can be scanned directly by v2rayNG or similar apps.
Requires qrcode package: npm install qrcode @types/qrcode
Optional display name for the links (default: "sentinel-js-sdk")
await v2ray.printShareQRCodes();
// Prints one QR code per outbound to stdout
Generated using TypeDoc
Generates share links for all outbounds in the current config. Returns one link per outbound, VMess or VLess depending on the protocol.