From 352ae3a84067697306a220119f8226440df5d82d Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sat, 23 Aug 2025 09:00:37 +0100 Subject: [PATCH] Added domain limit details to webpage Signed-off-by: Marcus Noble --- index.html | 12 +++++++++++- index.js | 8 ++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 4de3f20..55cc133 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,6 @@ - @@ -65,6 +64,17 @@
+
+ ℹ️ Details on blocked / allowed domains + To prevent abuse, the domains this proxy can be used with is limited by the following: +
+ Blocklist: [[BLOCKLIST]] +
+
+ Allowlist: [[ALLOWLIST]] +
+
+
diff --git a/index.js b/index.js index 42ea2cf..993bc12 100644 --- a/index.js +++ b/index.js @@ -79,11 +79,15 @@ http.createServer((req, response) => { }).listen(PORT); function loadWebpage(req, res) { - fs.readFile(__dirname + "/index.html") + fs.readFile(__dirname + "/index.html", { encoding: 'utf8' }) .then(contents => { res.setHeader("Content-Type", "text/html"); res.writeHead(200); - res.end(contents); + res.end( + contents + .replaceAll('[[BLOCKLIST]]', JSON.stringify(blockList)) + .replaceAll('[[ALLOWLIST]]', JSON.stringify(allowList)) + ); }) .catch(err => { res.writeHead(500);