Skip to content

Commit

Permalink
:)
Browse files Browse the repository at this point in the history
  • Loading branch information
xfy777 authored Dec 31, 2023
1 parent fd2e162 commit 34a3830
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
port: 3069,
token: "hushthisistemporary",
}
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

const express = require("express");
const { spawn } = require("child_process");
const { port, token } = require("./config");

const app = express();
const port = 3069;

app.use(express.json());

const activeConnections = new Map();

app.get("/start", (req, res) => {
let token = req.query.token;
let tokenParam = req.query.token;

if (!token || token !== "hushthisistemporary")
if (!tokenParam || tokenParam !== token)
return res.status(401).send("Unauthorized");

const tcpdumpProcess = spawn("sudo", ["tcpdump", "-l", "-i", "any", "-v"]);
Expand Down Expand Up @@ -44,5 +44,5 @@ app.get("/start", (req, res) => {
});

app.listen(port, () => {
console.log(`Server is running at http://localhost:${port}`);
console.log(`Server is running at :${port}`);
});

0 comments on commit 34a3830

Please sign in to comment.