XTLS/Xray-core · info

process lookup is not supported on this platform

Error message

process lookup is not supported on this platform

What it means

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.

Source

Thrown at common/net/find_process_ios.go:10

//go:build ios

package net

import (
	"github.com/xtls/xray-core/common/errors"
)

func FindProcess(network, srcIP string, srcPort uint16, destIP string, destPort uint16) (int, string, string, error) {
	return 0, "", "", errors.New("process lookup is not supported on this platform")
}

View on GitHub (pinned to 7d214f8b09)

Solutions

  1. Do not configure process-based routing rules (processName/processPath conditions) in iOS builds
  2. Guard call sites with runtime.GOOS or, better, exclude the call at build time with build tags
  3. Remove the FindProcess call path in the iOS app and route on IPs/domains instead

Example fix

// before
pid, name, path, err := net.FindProcess(network, srcIP, srcPort, dstIP, dstPort)

// after
var pid int
var name, path string
var err error
if runtime.GOOS != "ios" {
    pid, name, path, err = net.FindProcess(network, srcIP, srcPort, dstIP, dstPort)
}
Defensive patterns

Strategy: validation

Validate before calling

// iOS builds always fail; guard before calling
if runtime.GOOS == "ios" {
    return routeWithoutProcess(ctx)
}

Prevention

When it happens

Trigger: 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.

Common situations: Building a NetworkExtension VPN client for iOS that reuses Xray's routing config; process-based routing rules silently degrade to always-unmatched on iOS.

Related errors


AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15). Data as JSON: /api/errors/1cabdb1428259549. Report an issue: GitHub.