Added Querystrings

This commit is contained in:
TheEmeraldStarr 2020-10-23 03:03:47 +00:00
parent 3f70ce42c4
commit c18482cf1b
3 changed files with 161 additions and 25 deletions

160
app.js
View file

@ -9,7 +9,9 @@
websocket = require('./ws-proxy.js'),
fetch = require('node-fetch');
const config = JSON.parse(fs.readFileSync('./config.json', { encoding: 'utf8' }));
const config = JSON.parse(fs.readFileSync('./config.json', {
encoding: 'utf8'
}));
if (!config.prefix.startsWith('/')) {
config.prefix = `/${config.prefix}`;
}
@ -58,7 +60,9 @@
websiteURL = btoa(dataURL.split('/').splice(0, 3).join('/'));
websitePath = '/' + dataURL.split('/').splice(3).join('/');
}
if (websitePath == '/') { return `${websiteURL}`; } else return `${websiteURL}${websitePath}`;
if (websitePath == '/') {
return `${websiteURL}`;
} else return `${websiteURL}${websitePath}`;
};
var login = require('./auth');
@ -88,7 +92,9 @@
});
app.use(`${config.prefix}utils/`, async (req, res, next) => {
if (req.url.startsWith('/assets/')) { res.sendFile(__dirname + '/utils' + req.url); }
if (req.url.startsWith('/assets/')) {
res.sendFile(__dirname + '/utils' + req.url);
}
if (req.query.url) {
let url = atob(req.query.url);
if (url.startsWith('https://') || url.startsWith('http://')) {
@ -104,7 +110,13 @@
app.post(`${config.prefix}session/`, async (req, res, next) => {
let url = querystring.parse(req.raw_body).url;
if (url.startsWith('//')) { url = 'http:' + url; } else if (url.startsWith('https://') || url.startsWith('http://')) { url = url } else { url = 'http://' + url };
if (url.startsWith('//')) {
url = 'http:' + url;
} else if (url.startsWith('https://') || url.startsWith('http://')) {
url = url
} else {
url = 'http://' + url
};
return res.redirect(config.prefix + rewrite_url(url));
});
@ -177,13 +189,21 @@
if (req.method == 'POST') {
proxy.options.body = req.str_body;
}
if (proxy.url.hostname == 'discord.com' && proxy.url.path == '/') { return res.redirect(307, config.prefix + rewrite_url('https://discord.com/login')); };
if (proxy.url.hostname == 'discord.com' && proxy.url.path == '/') {
return res.redirect(307, config.prefix + rewrite_url('https://discord.com/login'));
};
if (proxy.url.hostname == 'www.reddit.com') { return res.redirect(307, config.prefix + rewrite_url('https://old.reddit.com')); };
if (proxy.url.hostname == 'www.reddit.com') {
return res.redirect(307, config.prefix + rewrite_url('https://old.reddit.com'));
};
if (!req.url.slice(1).startsWith(`${proxy.url.encoded_origin}/`)) { return res.redirect(307, config.prefix + proxy.url.encoded_origin + '/'); };
if (!req.url.slice(1).startsWith(`${proxy.url.encoded_origin}/`)) {
return res.redirect(307, config.prefix + proxy.url.encoded_origin + '/');
};
const blocklist = JSON.parse(fs.readFileSync('./blocklist.json', { encoding: 'utf8' }));
const blocklist = JSON.parse(fs.readFileSync('./blocklist.json', {
encoding: 'utf8'
}));
let is_blocked = false;
@ -193,7 +213,9 @@
}
});
if (is_blocked == true) { return res.send(fs.readFileSync('./utils/error/error.html', 'utf8').toString().replace('%ERROR%', `Error 401: The website '${sanitizer.sanitize(proxy.url.hostname)}' is not permitted!`)) }
if (is_blocked == true) {
return res.send(fs.readFileSync('./utils/error/error.html', 'utf8').toString().replace('%ERROR%', `Error 401: The website '${sanitizer.sanitize(proxy.url.hostname)}' is not permitted!`))
}
proxy.response = await fetch(proxy.url.href, proxy.options).catch(err => res.send(fs.readFileSync('./utils/error/error.html', 'utf8').toString().replace('%ERROR%', `Error 400: Could not make request to '${sanitizer.sanitize(proxy.url.href)}'!`)));
@ -258,7 +280,9 @@
// Temp hotfix for Youtube search bar until my script injection can fix it.
if (proxy.url.hostname == 'www.youtube.com') { proxy.sendResponse = proxy.sendResponse.replace(/\/results/gi, `${config.prefix}${proxy.url.encoded_origin}/results`); };
if (proxy.url.hostname == 'www.youtube.com') {
proxy.sendResponse = proxy.sendResponse.replace(/\/results/gi, `${config.prefix}${proxy.url.encoded_origin}/results`);
};
} else if (proxy.content_type.startsWith('text/css')) {
proxy.sendResponse = proxy.sendResponse.toString()
.replace(/url\("\/\/(.*?)"\)/gi, `url("http://` + `$1` + `")`)
@ -287,10 +311,124 @@
app.use('/', express.static('public'));
//Querystrings Here
app.get('/', async (req, res) => {
if (req.query.pd) {
return res.send(fs.readFile('./public/e.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.a) {
return res.send(fs.readFile('./public/e.html'))
return res.send(fs.readFile('./public/a.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.b) {
return res.send(fs.readFile('./public/b.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.p) {
return res.send(fs.readFile('./public/p.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.x) {
return res.send(fs.readFile('./public/x.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.d) {
return res.send(fs.readFile('./public/d.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.y) {
return res.send(fs.readFile('./public/y.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.yh) {
return res.send(fs.readFile('./public/yh.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.ym) {
return res.send(fs.readFile('./public/ym.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.g) {
return res.send(fs.readFile('./public/g.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.k) {
return res.send(fs.readFile('./public/k.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.m) {
return res.send(fs.readFile('./public/m.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.c) {
return res.send(fs.readFile('./public/c.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.t) {
return res.send(fs.readFile('./public/t.html'))
}
});
app.get('/', async (req, res) => {
if (req.query.z) {
return res.send(fs.readFile('./public/z.html'))
}
});

View file

@ -32,8 +32,7 @@
<div>
<div class="header-dark hd-base">
<nav class="navbar navbar-dark navbar-expand-lg navigation-clean-search" style="height: 100px;">
<div class="container"><a class="navbar-brand" style="font-family: 'Montserrat Alternates', sans-serif;font-size: 21px;margin: 10px;font-style: normal;font-weight: bold;" href="/">Ho&#8203;ly Unb&#8203;lock&#8203;er</a><button data-toggle="collapse" class="navbar-toggler"
data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<div class="container"><a class="navbar-brand" style="font-family: 'Montserrat Alternates', sans-serif;font-size: 21px;margin: 10px;font-style: normal;font-weight: bold;" href="/">Ho&#8203;ly Unb&#8203;lock&#8203;er</a><button data-toggle="collapse" class="navbar-toggler" data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navcol-1">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item" role="presentation"><a class="nav-link active" href="/z.html" style="font-family: 'Montserrat Alternates', sans-serif;">Su&#8203;rf Fre&#8203;ely</a></li>
@ -42,8 +41,7 @@
<li class="nav-item" role="presentation"><a class="nav-link" href="/d.html" style="font-family: 'Montserrat Alternates', sans-serif;">D&#8203;isc&#8203;ord</a></li>
<li class="nav-item" role="presentation"><a class="nav-link" href="/n.html" style="font-family: 'Montserrat Alternates', sans-serif;">Cha&#8203;tbox</a></li>
<li class="nav-item dropdown"><a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#" style="opacity: 0.80;color: rgb(255,255,255);font-family: 'Montserrat Alternates', sans-serif;">More</a>
<div class="dropdown-menu" role="menu" style="background-color: rgb(33,30,30);font-family: 'Titillium Web', sans-serif;padding: 17%;padding-top: 10%;padding-bottom: 10%;"><a class="dropdown-item text-left text-white-50" role="presentation" href="/k.html" style="color: rgb(255,255,255);padding: 0%;font-family: Lato, sans-serif;">Kru&#8203;nk&#8203;er</a><a class="dropdown-item text-left text-white-50"
role="presentation" href="/info.html" style="color: rgb(255,255,255);padding: 0%;font-family: Lato, sans-serif;">Docs</a><a class="dropdown-item text-white-50" role="presentation" href="/c.html" style="color: rgb(255,255,255);padding: 0%;font-family: Lato, sans-serif;">Cre&#8203;dits</a></div>
<div class="dropdown-menu" role="menu" style="background-color: rgb(33,30,30);font-family: 'Titillium Web', sans-serif;padding: 17%;padding-top: 10%;padding-bottom: 10%;"><a class="dropdown-item text-left text-white-50" role="presentation" href="/k.html" style="color: rgb(255,255,255);padding: 0%;font-family: Lato, sans-serif;">Kru&#8203;nk&#8203;er</a><a class="dropdown-item text-left text-white-50" role="presentation" href="/info.html" style="color: rgb(255,255,255);padding: 0%;font-family: Lato, sans-serif;">Docs</a><a class="dropdown-item text-white-50" role="presentation" href="/c.html" style="color: rgb(255,255,255);padding: 0%;font-family: Lato, sans-serif;">Cre&#8203;dits</a></div>
</li>
<!--Options Menu-->
<li id="csel" class="nav-item dropdown"><a class="dropdown-toggle nav-link text-white" data-toggle="dropdown" aria-expanded="false" href="#" style="opacity: 0.80;font-family: 'Montserrat Alternates', sans-serif;">Options</a>
@ -87,7 +85,7 @@
<!-- Splash Text -->
<div class="d-flex align-items-center order-12 in-splash">
<div class="container text-center justify-content-center align-items-center in-center">
<h1 class="text-center d-md-flex flex-grow-1 justify-content-md-center align-items-md-center in-center in-splash-text">End Int&#8203;ernet Censo&#8203;rship.<br>Priva&#8203;cy right at your fingertips.</h1><button class="button rounded in-btn-color" type="button" data-hover="Epic!"><span><a href="z.html">By<wbr>p<wbr><span style=display:none data-oenfewpq=hehe>Cooking at a higher temperature (500 degrees F (260 degrees C)) is the key to making this the perfect pizza. It doesn't get any easier than this folks. Brush dough with olive oil and add your favorite toppings. Enjoy! By Michele Leigh Pinette Pierce</span>a<wbr>s<wbr>s n<wbr>ow?</a></span></button>
<h1 class="text-center d-md-flex flex-grow-1 justify-content-md-center align-items-md-center in-center in-splash-text">End Int&#8203;ernet Censo&#8203;rship.<br>Priva&#8203;cy right at your fingertips.</h1><button class="button rounded in-btn-color" type="button" data-hover="Epic!"><span><a href="/?z">By<wbr>p<wbr><span style=display:none data-oenfewpq=hehe>Cooking at a higher temperature (500 degrees F (260 degrees C)) is the key to making this the perfect pizza. It doesn't get any easier than this folks. Brush dough with olive oil and add your favorite toppings. Enjoy! By Michele Leigh Pinette Pierce</span>a<wbr>s<wbr>s n<wbr>ow?</a></span></button>
</div>
</div>
</div>

View file

@ -88,10 +88,10 @@
<p class="text-light" style="font-family: Lato, sans-serif;">A&#8203;llo&#8203;y: Yo&#8203;uTu&#8203;be (Full), Co&#8203;olMa&#8203;thGa&#8203;mes, etc.<br><br>Nod&#8203;e: Secondary pr&#8203;oxy compared to Al&#8203;loy, PM and PD.<br><br>P<wbr>M Pro<wbr>xy: Disc<wbr>ord, Yout<wbr>ube
(limited), etc.<br><br>PyD<wbr>od<wbr>ge: Alternative pro<wbr>xy.<br><br><strong>Many sites work with this. Join the T<wbr>N disc<wbr>ord for updated H<wbr>B sites and more. Explore!</strong><br>T<wbr>N D<wbr>isco<wbr>rd:
<a class="text-light" id="tnlink">https://dis&#8203;cord.c&#8203;om/invite/Dw&#8203;6C7p&#8203;5</a><br></p>
<div class="btn-group" role="group" style="background-color: #030303;margin: 2%;padding: 1px;"><a class="btn btn-primary text-info border rounded-0 border-primary" role="button" data-bs-hover-animate="pulse" style="background-color: rgb(24,26,28);font-family: 'Montserrat Alternates', sans-serif;" href="/a.html">Al&#8203;loy Pro&#8203;xy</a>
<a class="btn btn-primary text-info border rounded-0 border-primary" role="button" data-bs-hover-animate="pulse" style="background-color: rgb(24,26,28);font-family: 'Montserrat Alternates', sans-serif;" href="/b.html">No<wbr>de Un<wbr>bloc<wbr>ker</a>
<a class="btn btn-primary text-info border rounded-0 border-primary" role="button" data-bs-hover-animate="pulse" style="background-color: rgb(24,26,28);font-family: 'Montserrat Alternates', sans-serif;" href="/p.html">PM Pro<wbr>xy</a>
<a class="btn btn-primary text-info border rounded-0 border-primary" role="button" data-bs-hover-animate="pulse" style="background-color: rgb(24,26,28);font-family: 'Montserrat Alternates', sans-serif;" href="/e.html">PyD<wbr>odge Pr<wbr>oxy</a>
<div class="btn-group" role="group" style="background-color: #030303;margin: 2%;padding: 1px;"><a class="btn btn-primary text-info border rounded-0 border-primary" role="button" data-bs-hover-animate="pulse" style="background-color: rgb(24,26,28);font-family: 'Montserrat Alternates', sans-serif;" href="/?a">Al&#8203;loy Pro&#8203;xy</a>
<a class="btn btn-primary text-info border rounded-0 border-primary" role="button" data-bs-hover-animate="pulse" style="background-color: rgb(24,26,28);font-family: 'Montserrat Alternates', sans-serif;" href="/?b">No<wbr>de Un<wbr>bloc<wbr>ker</a>
<a class="btn btn-primary text-info border rounded-0 border-primary" role="button" data-bs-hover-animate="pulse" style="background-color: rgb(24,26,28);font-family: 'Montserrat Alternates', sans-serif;" href="/?p">PM Pro<wbr>xy</a>
<a class="btn btn-primary text-info border rounded-0 border-primary" role="button" data-bs-hover-animate="pulse" style="background-color: rgb(24,26,28);font-family: 'Montserrat Alternates', sans-serif;" href="/?pd">PyD<wbr>odge Pr<wbr>oxy</a>
</div>
</form>
</div>