{"record":{"id":"1cabdb1428259549","repo":"XTLS/Xray-core","slug":"process-lookup-is-not-supported-on-this-platform","errorCode":null,"errorMessage":"process lookup is not supported on this platform","messagePattern":"process lookup is not supported on this platform","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"common/net/find_process_ios.go","lineNumber":10,"sourceCode":"//go:build ios\n\npackage net\n\nimport (\n\t\"github.com/xtls/xray-core/common/errors\"\n)\n\nfunc FindProcess(network, srcIP string, srcPort uint16, destIP string, destPort uint16) (int, string, string, error) {\n\treturn 0, \"\", \"\", errors.New(\"process lookup is not supported on this platform\")\n}\n","sourceCodeStart":1,"sourceCodeEnd":12,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/common/net/find_process_ios.go#L1-L12","documentation":"FindProcess on iOS (build tag 'ios') is a stub that unconditionally returns this error: process lookup is intentionally not implemented for iOS. Apple's sandbox makes per-process socket enumeration impossible for third-party apps, so the API surface exists but always fails.","triggerScenarios":"Compiling xray-core with GOOS=darwin GOARCH=arm64 and the ios build tag (or any iOS target). Every single call to FindProcess returns this error by construction.","commonSituations":"Building a NetworkExtension VPN client for iOS that reuses Xray's routing config; process-based routing rules silently degrade to always-unmatched on iOS.","solutions":["Do not configure process-based routing rules (processName/processPath conditions) in iOS builds","Guard call sites with runtime.GOOS or, better, exclude the call at build time with build tags","Remove the FindProcess call path in the iOS app and route on IPs/domains instead"],"exampleFix":"// before\npid, name, path, err := net.FindProcess(network, srcIP, srcPort, dstIP, dstPort)\n\n// after\nvar pid int\nvar name, path string\nvar err error\nif runtime.GOOS != \"ios\" {\n    pid, name, path, err = net.FindProcess(network, srcIP, srcPort, dstIP, dstPort)\n}","handlingStrategy":"validation","validationCode":"// iOS builds always fail; guard before calling\nif runtime.GOOS == \"ios\" {\n    return routeWithoutProcess(ctx)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Exclude process-based routing rules from iOS configurations entirely","Use build tags or runtime.GOOS checks at the single call site instead of error handling per call"],"tags":["ios","process-lookup","unsupported-platform","build-tags"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}