Skip to content

Commit

Permalink
Update inspectorProxy with IPV6 localhost address (#662)
Browse files Browse the repository at this point in the history
Summary:
**Summary**

For IPV4 the webSocketDebuggerUrl defaults to `ws://localhost:8081` but for IPV6 this defaults to `ws://[::]:8081`. This causes issues since `ws://[::]` is not a valid websocket URL, I am guessing it should be `ws:[::1]` which is the IPV6 equivalent.

**Test plan**

The webSocketDebuggerUrl should be `ws:[::1]` rather than `ws://[::]`.

This is related to this issue in Flipper facebook/flipper#1520.

Pull Request resolved: #662

Reviewed By: GijsWeterings

Differential Revision: D29210395

Pulled By: motiz88

fbshipit-source-id: 1522265f786765156aa650c704ad5d2c0605ca24
  • Loading branch information
patrickgalbraith authored and facebook-github-bot committed Jun 24, 2021
1 parent fb0a075 commit 25be2a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/metro-inspector-proxy/src/InspectorProxy.js
Expand Up @@ -98,7 +98,7 @@ class InspectorProxy {
addWebSocketListener(server: HttpServer | HttpsServer) {
const {port} = server.address();
if (server.address().family === 'IPv6') {
this._serverAddressWithPort = `[::]:${port}`;
this._serverAddressWithPort = `[::1]:${port}`;
} else {
this._serverAddressWithPort = `localhost:${port}`;
}
Expand Down

0 comments on commit 25be2a8

Please sign in to comment.