Commit 4a59f90
fix(ios): devsupport IPv6 host parsing for packager and inspector (#55923)
Summary:
When Metro host is an IPv6, iOS dev-support had two parsing issues, causing SIGABRTs):
1. `RCTPackagerConnection` parsed `host:port` by splitting on `:`, which breaks IPv6 literals and can build an invalid websocket URL for `/message`.
2. `RCTInspectorDevServerHelper` used `NSURL.host` directly to compose `host[:port]`. For IPv6, `NSURL.host` is unbracketed, producing an invalid authority for inspector endpoints.
Changes:
- `RCTPackagerConnection`: parse host/port via `NSURLComponents` from a synthesized URL instead of splitting by `:`.
- `RCTInspectorDevServerHelper`: re-add IPv6 brackets when composing authority strings from `NSURL.host`.
## Changelog:
[IOS] [FIXED] - Fix iOS dev-support IPv6 handling for packager and inspector connections.
Pull Request resolved: #55923
Test Plan:
- Built RNTester Debug (Hermes + New Architecture) for iOS simulator.
- Started Metro on IPv6:
- `RCT_METRO_PORT=8088 yarn --cwd packages/rn-tester start --host :: --port 8088`
- Launched RNTester with IPv6 Metro host in settings:
- `RCT_packager_scheme = http`
- `RCT_jsLocation = [2a02:...]:8088`
- Verified in logs:
- `http://[2a02:...]:8088/status` returns 200
- bundle loads from `http://[2a02:...]:8088/js/RNTesterApp.ios.bundle?...`
- Verified app remains running and renders RNTester UI (no SIGABRT in packager/inspector startup paths).
Reviewed By: vzaidman, cortinico
Differential Revision: D95564862
Pulled By: cipolleschi
fbshipit-source-id: 4fbdf00ca604a2b2ec40dd0ba9b92a146e6b10f21 parent 77332d2 commit 4a59f90
2 files changed
Lines changed: 17 additions & 11 deletions
File tree
- packages/react-native/React/DevSupport
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
Lines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 67 | | |
77 | 68 | | |
78 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | | - | |
| 82 | + | |
81 | 83 | | |
82 | | - | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
0 commit comments