Skip to content

fix: auto-discover the RemotePairing port across reboots - #484

Closed
cklsit wants to merge 2 commits into
StikDebug:mainfrom
cklsit:claude/stikdebug-port-49898-403ce6
Closed

cklsit wants to merge 2 commits into
StikDebug:mainfrom
cklsit:claude/stikdebug-port-49898-403ce6

Conversation

@cklsit

@cklsit cklsit commented Oct 18, 2026

Copy link
Copy Markdown

Summary

  • iOS randomizes the RemotePairing port on each boot (observed 49898 before a reboot and 49152 after), so a hardcoded port makes tunnel creation fail with Code 16: Failed to create tunnel: InternalError("connect: device socket io failed") once the device restarts.
  • Browse the advertised _remotepairing._tcp Bonjour service and use its port, caching the result and retrying once after a connection failure.
  • Fall back to the previous default (49152) when discovery is unavailable, and add an optional RemotePair Port override in Settings.
  • Register _remotepairing._tcp in NSBonjourServices and add NSLocalNetworkUsageDescription.

Test plan

  • Built from the fork branch and installed on iPad (iPadOS 27.0.1); with LocalDevVPN connected, JIT now starts successfully.
  • Rebooted the device: the port changed and the tunnel still connects via discovery.
  • Manual port override in Settings takes precedence when set.

🤖 Generated with Claude Code

cklsit and others added 2 commits October 18, 2026 21:37
Co-Authored-By: Claude Haiku 4.5 (1M context) <noreply@anthropic.com>
iOS randomizes the RemotePairing port across reboots, so a fixed port
breaks after restarting the device. Browse the advertised
_remotepairing._tcp service, cache the result, and fall back to the
default. Adds an optional port override in Settings.

Co-Authored-By: Claude Haiku 4.5 (1M context) <noreply@anthropic.com>
@cklsit cklsit closed this Oct 18, 2026
@cklsit
cklsit deleted the claude/stikdebug-port-49898-403ce6 branch October 18, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant