This commit is contained in:
TheEmeraldStarr 2020-10-02 09:24:20 -07:00
parent a02f6e7e30
commit 55910ea89e
2 changed files with 219 additions and 223 deletions

14
app.js
View file

@ -23,13 +23,8 @@
key: fs.readFileSync('./ssl/default.key'), key: fs.readFileSync('./ssl/default.key'),
cert: fs.readFileSync('./ssl/default.crt') cert: fs.readFileSync('./ssl/default.crt')
} }
if (config.ssl == true) { if (config.ssl == true) { server = https.createServer(server_options, app); server_protocol = 'https://';}
server = https.createServer(server_options, app); else { server = http.createServer(app); server_protocol = 'http://';};
server_protocol = 'https://';
} else {
server = http.createServer(app);
server_protocol = 'http://';
};
console.log(`Alloy Proxy now running on ${server_protocol}0.0.0.0:${config.port}! Proxy prefix is "${config.prefix}"!`); console.log(`Alloy Proxy now running on ${server_protocol}0.0.0.0:${config.port}! Proxy prefix is "${config.prefix}"!`);
@ -99,9 +94,10 @@
app.post(`${config.prefix}session/`, async(req, res, next) => { app.post(`${config.prefix}session/`, async(req, res, next) => {
let url = querystring.parse(req.raw_body).url; 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)); return res.redirect(config.prefix + rewrite_url(url));
}); });
app.use(config.prefix, async(req, res, next) => { app.use(config.prefix, async(req, res, next) => {

View file

@ -1,7 +1,7 @@
{ {
"name": "Alloy Proxy", "name": "Holy Unblocker",
"description": "A node.js web proxy featuring URL encoding, and amazing compatablity!", "description": "A website that can be used to bypass web filters; both extension and firewall. Alloy Proxy hosted locally. (Can be used as a template.)",
"repository": "https://github.com/titaniumnetwork-dev/alloyproxy/", "repository": "https://github.com/QuiteAFancyEmerald/HolyUnblockerPublic/",
"logo": "https://avatars1.githubusercontent.com/u/47227492?s=200&v=4", "logo": "https://www.holyubofficial.ml/assets/img/i.png",
"keywords": ["node", "proxy", "unblocker"] "keywords": ["node", "proxy", "unblocker", "webproxy", "games", "holyunblocker", "alloy"]
} }