metro-inspector-proxy
Advanced tools
Comparing version 0.53.0 to 0.53.1
{ | ||
"name": "metro-inspector-proxy", | ||
"version": "0.53.0", | ||
"version": "0.53.1", | ||
"description": "metro-inspector-proxy", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -11,14 +11,7 @@ /** | ||
"use strict"; | ||
/** | ||
* Runs new HTTP Server and attaches Inspector Proxy to it. | ||
*/ | ||
const connect = require("connect"); | ||
const http = require("http"); | ||
const yargs = require("yargs"); | ||
const _require = require("./index"), | ||
InspectorProxy = _require.InspectorProxy; | ||
runInspectorProxy = _require.runInspectorProxy; | ||
@@ -31,8 +24,2 @@ yargs.option("port", { | ||
}); | ||
const inspectorProxy = new InspectorProxy(); | ||
const app = connect(); | ||
app.use(inspectorProxy.processRequest.bind(inspectorProxy)); | ||
const httpServer = http.createServer(app); | ||
httpServer.listen(yargs.argv.port, "127.0.0.1", () => { | ||
inspectorProxy.addWebSocketListener(httpServer); | ||
}); | ||
runInspectorProxy(yargs.argv.port); |
@@ -12,6 +12,24 @@ /** | ||
const InspectorProxy = require("./InspectorProxy"); | ||
const InspectorProxy = require("./InspectorProxy"); // Runs new HTTP Server and attaches Inspector Proxy to it. | ||
// Requires are inlined here because we don't want to import them | ||
// when someone needs only InspectorProxy instance (without starting | ||
// new HTTP server). | ||
function runInspectorProxy(port) { | ||
const inspectorProxy = new InspectorProxy(); | ||
const app = require("connect")(); | ||
app.use(inspectorProxy.processRequest.bind(inspectorProxy)); | ||
const httpServer = require("http").createServer(app); | ||
httpServer.listen(port, "127.0.0.1", () => { | ||
inspectorProxy.addWebSocketListener(httpServer); | ||
}); | ||
} | ||
module.exports = { | ||
InspectorProxy | ||
InspectorProxy, | ||
runInspectorProxy | ||
}; |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30776
462
1