Updated Alloy Proxy

This commit is contained in:
QuiteAFancyEmerald 2020-11-12 03:26:09 +00:00
parent 003b5da951
commit 2bc4785d47
6 changed files with 25 additions and 54 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
node_modules
.gitpod.yml
package-lock.json

20
app.js
View file

@ -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);

View file

@ -1,4 +1,3 @@
{
"port": "8080",
"ssl": false
"port": "8080"
}

View file

@ -12,7 +12,7 @@ $('al').onclick = function() {
var det = document.domain;
var domain = det.replace('www.', '').split(/[/?#]/)[0];
const origin = btoa(url)
frame.src = "https://cdn." + domain + "/fetch/utils/?url=" + origin;
frame.src = "https://" + domain + "/fetch/" + origin;
frame.style['visibility'] = "visible";
document.cookie = 'oldsmobile=badcar; expires=' + (Date.now() + 259200) + '; SameSite=Lax; domain=.' + auth + '; path=/; Secure;';
return false;
@ -23,7 +23,7 @@ $('albp').onclick = function() {
var det = document.domain;
var domain = det.replace('www.', '').split(/[/?#]/)[0];
const origin = btoa(url)
window.location.href = "https://cdn." + domain + "/fetch/utils/?url=" + origin;
window.location.href = "https://" + domain + "/fetch/" + origin;
document.cookie = 'oldsmobile=badcar; expires=' + (Date.now() + 259200) + '; SameSite=Lax; domain=.' + auth + '; path=/; Secure;';
return false;
};
@ -107,7 +107,7 @@ $('ytbtn').onclick = function() {
var det = document.domain;
var domain = det.replace('www.', '').split(/[/?#]/)[0];
const origin = btoa(yt)
frame.src = "https://cdn." + domain + "/fetch/utils/?url=" + origin;
frame.src = "https://" + domain + "/fetch/" + origin;
frame.style['visibility'] = "visible";
document.cookie = 'oldsmobile=badcar; expires=' + (Date.now() + 259200) + '; SameSite=Lax; domain=.' + auth + '; path=/; Secure;';
return false;
@ -118,7 +118,7 @@ $('ytbtnm').onclick = function() {
var det = document.domain;
var domain = det.replace('www.', '').split(/[/?#]/)[0];
const origin = btoa(yt)
frame.src = "https://cdn." + domain + "/fetch/utils/?url=" + origin;
frame.src = "https://" + domain + "/fetch/" + origin;
frame.style['visibility'] = "visible";
document.cookie = 'oldsmobile=badcar; expires=' + (Date.now() + 259200) + '; SameSite=Lax; domain=.' + auth + '; path=/; Secure;';
return false;
@ -129,7 +129,7 @@ $('ytbp').onclick = function() {
var det = document.domain;
var domain = det.replace('www.', '').split(/[/?#]/)[0];
const origin = btoa(yt)
window.location.href = "https://cdn." + domain + "/fetch/utils/?url=" + origin;
window.location.href = "https://" + domain + "/fetch/" + origin;
document.cookie = 'oldsmobile=badcar; expires=' + (Date.now() + 259200) + '; SameSite=Lax; domain=.' + auth + '; path=/; Secure;';
return false;
};
@ -140,7 +140,7 @@ $('dbtn').onclick = function() {
var det = document.domain;
var domain = det.replace('www.', '').split(/[/?#]/)[0];
const origin = btoa(d)
frame.src = "https://cdn." + domain + "/fetch/utils/?url=" + origin;
frame.src = "https://" + domain + "/fetch/" + origin;
frame.style['visibility'] = "visible";
document.cookie = 'oldsmobile=badcar; expires=' + (Date.now() + 259200) + '; SameSite=Lax; domain=.' + auth + '; path=/; Secure;';
return false;
@ -151,7 +151,7 @@ $('dbp').onclick = function() {
var det = document.domain;
var domain = det.replace('www.', '').split(/[/?#]/)[0];
const origin = btoa(d)
window.location.href = "https://cdn." + domain + "/fetch/utils/?url=" + origin;
window.location.href = "https://" + domain + "/fetch/" + origin;
document.cookie = 'oldsmobile=badcar; expires=' + (Date.now() + 259200) + '; SameSite=Lax; domain=.' + auth + '; path=/; Secure;';
return false;
};

View file

@ -1,41 +0,0 @@
var GameboyJS;
(function (GameboyJS) {
"use strict";
// Utility functions
var Util = {
// Add to the first argument the properties of all other arguments
extend: function(target /*, source1, source2, etc. */) {
var sources = Array.prototype.slice.call(arguments);
for (var i in sources) {
var source = sources[i];
for (var name in source) {
target[name] = source[name];
}
}
return target;
},
testFlag: function(p, cc) {
var test=1;
var mask=0x10;
if (cc=='NZ'||cc=='NC') test=0;
if (cc=='NZ'||cc=='Z') mask=0x80;
return (test && p.r.F&mask) || (!test && !(p.r.F&mask));
},
getRegAddr: function(p, r1, r2) {return Util.makeword(p.r[r1], p.r[r2]);},
// make a 16 bits word from 2 bytes
makeword: function(b1, b2) {return (b1 << 8) + b2;},
// return the integer signed value of a given byte
getSignedValue: function(v) {return v & 0x80 ? v-256 : v;},
// extract a bit from a byte
readBit: function(byte, index) {
return (byte >> index) & 1;
}
};
GameboyJS.Util = Util;
}(GameboyJS || (GameboyJS = {})));