Skip to content

v1.7 — iOS/macOS dialer controller (IP_BOUND_IF socket binding)

Latest

Choose a tag to compare

@bududomasidet bududomasidet released this 10 Aug 16:12
· 2 commits to main since this release

Adds the dialer/listener controller to the Apple (iOS/macOS) gomobile build, so
outbound xray sockets can be bound to the active network interface via IP_BOUND_IF
from Swift — the iOS analogue of Android's VpnService.protect(fd). This is Phase 2
of the WiFi<->cellular fast-reconnect fix.

Changes vs v1.6:

  • New controller/controller_apple.go (//go:build darwin): RegisterDialerController /
    RegisterListenerController wrapping xray-core's internet.RegisterDialerController.
  • New apple_wrapper.go (//go:build darwin): gomobile-facing DialerController
    interface (ProtectFd(int) bool) + RegisterDialerController / RegisterListenerController.
    DNS remains handled by dns_wrapper.go (!android); no DNS APIs redefined.

New exported symbols (ios-arm64 / simulator / macos):

  • void LibXrayRegisterDialerController(id<LibXrayDialerController>)
  • void LibXrayRegisterListenerController(id<LibXrayDialerController>)
  • @protocol LibXrayDialerController <NSObject> - (BOOL)protectFd:(long);

Built with: gomobile bind -target ios,iossimulator,macos -iosversion 15.0
(xray-core v1.250831.0, Go 1.25). No changes to existing RunXray/StopXray API.

SwiftPM checksum: 2663f6ee8a3ba693d0ab8af70060751fdcab96155e96802bf0ccc719812c20ba