Running as a child process from NodeJS #779
-
httpx version:1.2.4 Current Behavior:I'm trying to run httpx from a NodeJS script(typescript): const { spawn } = require("node:child_process");
const cmd = spawn("httpx", [
"-l",
"/tmp/subdomains.txt",
"-ct",
"-v",
"-debug",
]);
cmd.stdout.on("data", (data: any) => {
console.log(`stdout: ${data}`);
});
cmd.stderr.on("data", (data: any) => {
console.error(`stderr: ${data}`);
});
cmd.on("close", (code: any) => {
console.log(`child process exited with code ${code}`);
}); I'm getting the following output, then the execution just stuck(I suppose before making any requests): __ __ __ _ __
/ /_ / /_/ /_____ | |/ /
/ __ \/ __/ __/ __ \| /
/ / / / /_/ /_/ /_/ / |
/_/ /_/\__/\__/ .___/_/|_|
/_/ v1.2.4
projectdiscovery.io
Use with caution. You are responsible for your actions.
Developers assume no liability and are not responsible for any misuse or damage.
Expected Behavior:I expect to see the same output as if running command from cli. Steps To Reproduce:
Anything else:NodeJS version: 16.17.0 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Try closing the child.stdin.end() |
Beta Was this translation helpful? Give feedback.
-
@forgedhallpass thanks, it works! |
Beta Was this translation helpful? Give feedback.
Try closing the
stdin
from your code: