mirror of
https://github.com/QuiteAFancyEmerald/Holy-Unblocker.git
synced 2025-05-12 11:30:01 -04:00
Updated Alloy Proxy
This commit is contained in:
parent
003b5da951
commit
2bc4785d47
6 changed files with 25 additions and 54 deletions
20
app.js
20
app.js
|
@ -5,6 +5,7 @@
|
|||
|
||||
const
|
||||
express = require('express'),
|
||||
alloy = require('alloyproxy'),
|
||||
app = express(),
|
||||
http = require('http'),
|
||||
fs = require('fs'),
|
||||
|
@ -14,11 +15,20 @@ const
|
|||
const config = JSON.parse(fs.readFileSync('./config.json', {
|
||||
encoding: 'utf8'
|
||||
}));
|
||||
|
||||
const server = http.createServer(app);
|
||||
|
||||
let server;
|
||||
//Local Alloy Proxy
|
||||
const unblocker = new alloy({
|
||||
prefix: '/fetch/',
|
||||
request: [],
|
||||
response: [],
|
||||
injection: true,
|
||||
});
|
||||
|
||||
server = http.createServer(app);
|
||||
server.listen(process.env.PORT || config.port);
|
||||
app.use(unblocker.app);
|
||||
|
||||
unblocker.ws(server);
|
||||
|
||||
app.post('/', async(req, res) => {
|
||||
switch (req.url) {
|
||||
|
@ -30,4 +40,6 @@ app.post('/', async(req, res) => {
|
|||
//Querystrings
|
||||
app.get('/', async(req, res, t) => res.send(fs.readFileSync(path.join(__dirname, 'public', 'pages,index.html,info.html,archive,archive,hidden.html'.split(',')['/,/?in,/?fg,/?rr,/?j'.split(',').indexOf(req.url) + 1], ',surf.html,f.html,run.html,frames,redirects3,proxnav5,nav7'.replace(/,[^,]+/g, e => ([] + e.match(/\D+/)).repeat(+e.match(/\d+/) + 1)).split(',')[t = 'z,fg,rr,k,dd,n,yh,ym,a,b,y,e,d,p,c,f,g,h,i,m,t,x'.split(',').indexOf(req.url.slice(2)) + 1], (t = ',,,,krunker,discordprox,chatbox,ythub,ytmobile,alloy,node,youtube,pydodge,discordhub,pmprox,credits,flash,gtools,games5,icons,gba,terms,bookmarklets'.split(',')[t]) && t + '.html'), 'utf8')));
|
||||
|
||||
app.use(char_insert.static(path.join(__dirname, 'public')));
|
||||
app.use(char_insert.static(path.join(__dirname, 'public')));
|
||||
|
||||
server.listen(process.env.PORT || config.port);
|
Loading…
Add table
Add a link
Reference in a new issue