From 98e5d71b0742044ea7c99150f592bb483944540f Mon Sep 17 00:00:00 2001 From: MunyDev Date: Sun, 26 Jan 2025 18:29:34 -0500 Subject: [PATCH] Updated httpmitm: Made it so that it needs to run python3 srver manually for testing --- configs/m.google.com/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/m.google.com/index.js b/configs/m.google.com/index.js index 2907362..66f44e0 100644 --- a/configs/m.google.com/index.js +++ b/configs/m.google.com/index.js @@ -19,7 +19,7 @@ function filter(f) { return false; } async function startServerIfNeeded() { - if (state.pid) return; + return; // run the python3 srv manually for now let realpath = path.resolve('.', 'dmbackend', 'start_server.sh') let prc = child_proc.spawn("/bin/bash", [path.resolve('.', 'dmbackend', 'start_server.sh'), realpath], {stdio: "pipe"}); let wstream = fs.createWriteStream("./int_server.log"); @@ -68,7 +68,7 @@ app.post("/*", async function (req, res) { fetch = (await import('node-fetch')).default; await startServerIfNeeded(); - const resFromRev = await fetch('http://localhost:3040/' + url.parse(req.url).search, { + const resFromRev = await fetch('http://127.0.0.1:3040/' + url.parse(req.url).search, { body: dat, "headers": req.headers, method: "POST" @@ -121,7 +121,7 @@ function proxy(config, sock) { }, path.resolve(__dirname, "public", "google.com.pem"), path.resolve(__dirname, "public", "google.com.key")) const socks = net.createConnection({ - host: "localhost", + host: "127.0.0.1", port: ms.port }, function () { sock.write('HTTP/1.1 200 OK\r\n\n');