metro-inspector-proxy
Advanced tools
Comparing version 0.78.0 to 0.78.1
{ | ||
"name": "metro-inspector-proxy", | ||
"version": "0.78.0", | ||
"version": "0.78.1", | ||
"description": "🚇 Inspector proxy for React Native and dev tools integration.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -39,3 +39,3 @@ /** | ||
// by debugger to know where to connect. | ||
_serverAddressWithPort = ""; | ||
_serverBaseUrl = ""; | ||
constructor(projectRoot) { | ||
@@ -76,8 +76,13 @@ this._projectRoot = projectRoot; | ||
// Adds websocket listeners to the provided HTTP/HTTPS server. | ||
createWebSocketListeners(server) { | ||
const { port } = server.address(); | ||
if (server.address().family === "IPv6") { | ||
this._serverAddressWithPort = `[::1]:${port}`; | ||
createWebSocketListeners(serverOrBaseUrl) { | ||
if (typeof serverOrBaseUrl === "string") { | ||
this._serverBaseUrl = serverOrBaseUrl; | ||
} else { | ||
this._serverAddressWithPort = `localhost:${port}`; | ||
const address = serverOrBaseUrl.address(); | ||
const port = address.port; | ||
if (address.family === "IPv6") { | ||
this._serverBaseUrl = `[::1]:${port}`; | ||
} else { | ||
this._serverBaseUrl = `localhost:${port}`; | ||
} | ||
} | ||
@@ -93,3 +98,3 @@ return { | ||
_buildPageDescription(deviceId, device, page) { | ||
const debuggerUrl = `${this._serverAddressWithPort}${WS_DEBUGGER_URL}?device=${deviceId}&page=${page.id}`; | ||
const debuggerUrl = `${this._serverBaseUrl}${WS_DEBUGGER_URL}?device=${deviceId}&page=${page.id}`; | ||
const webSocketDebuggerUrl = "ws://" + debuggerUrl; | ||
@@ -96,0 +101,0 @@ const devtoolsFrontendUrl = |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65664
900