Added Corrosion Fix for Heroku

Credits: https://github.com/BinBashBanana/Corrosion-Heroku (very epic person)
This commit is contained in:
TheEmeraldStarr 2021-11-29 23:40:38 -08:00
parent 8d88daf1c2
commit b0c48df26c
25 changed files with 13 additions and 10 deletions

View file

@ -1,7 +1,7 @@
{
"name": "Holy Unblocker",
"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/QuiteAFancyEmerald/HolyUnblockerPublic/",
"logo": "https://github.com/QuiteAFancyEmerald/HolyUnblockerPublic/blob/master/views/assets/img/i.png?raw=true",
"keywords": ["node", "proxy", "unblocker", "webproxy", "games", "holyunblocker", "alloy"]
"description": "Holy Unblocker is a secure web proxy service supporting numerous sites while concentrating on detail with design, mechanics, and features. Bypass web filters regardless of whether it is an extension or network-based.",
"repository": "https://github.com/titaniumnetwork-dev/Holy-Unblocker",
"logo": "https://github.com/titaniumnetwork-dev/Holy-Unblocker/blob/master/views/assets/img/i.png?raw=true",
"keywords": ["holyunblocker", "womginx", "corrosion", "titaniumnetwork", "node", "proxy", "unblocker", "webproxy", "games"]
}

View file

@ -105,6 +105,7 @@ const proxy = new corrosion({
prefix: config.prefix || '/search/',
codec: config.codec || 'xor',
ws: config.ws,
forceHttps: true,
requestMiddleware: [
corrosion.middleware.blacklist(blacklist, 'Service not allowed due to bot protection! Make sure you are not trying to verify on a proxy.'),
],

View file

@ -19,6 +19,7 @@ class Rewrite {
constructor(config = defaultConfig) {
this.config = Object.assign(defaultConfig, config);
this.prefix = this.config.prefix;
this.forceHttps = this.config.forceHttps;
this.url = new URLWrapper(this.config || {});
this.codec = this.url.codec;
this.cookies = new CookieRewriter(this);

View file

@ -13,6 +13,7 @@ const fs = require('fs');
const defaultConfig = {
prefix: '/service/',
codec: 'plain',
forceHttps: false,
ws: true,
cookie: true,
title: 'Service',

View file

@ -13,12 +13,12 @@ function createRequestProxy(ctx) {
const requestContext = {
url: urlData.value,
flags: urlData.flags,
origin: (clientRequest.socket.encrypted ? 'https://' : 'http://') + clientRequest.headers.host,
origin: ((clientRequest.socket.encrypted || ctx.config.forceHttps) ? 'https://' : 'http://') + clientRequest.headers.host,
body: await getChunks(clientRequest),
headers: { ...clientRequest.headers },
method: clientRequest.method,
rewrite: ctx,
agent: new (urlData.value.protocol == 'https:' ? https : http).Agent({
agent: new ((urlData.value.protocol == 'https:' || ctx.config.forceHttps) ? https : http).Agent({
rejectUnauthorized: false,
}),
address: null,
@ -27,7 +27,7 @@ function createRequestProxy(ctx) {
};
for (let i in ctx.config.requestMiddleware) ctx.config.requestMiddleware[i](requestContext);
if (clientResponse.writableEnded) return;
(requestContext.url.protocol == 'https:' ? https : http).request({
((requestContext.url.protocol == 'https:' || ctx.config.forceHttps) ? https : http).request({
headers: requestContext.headers,
method: requestContext.method,
hostname: requestContext.url.hostname,

View file

@ -13,7 +13,7 @@ function createWebSocketProxy(ctx) {
headers: { ...clientRequest.headers },
method: clientRequest.method,
rewrite: ctx,
agent: new (urlData.value.protocol == 'https:' ? https : http).Agent({
agent: new ((urlData.value.protocol == 'https:' || ctx.config.forceHttps) ? https : http).Agent({
rejectUnauthorized: false,
}),
address: null,
@ -22,7 +22,7 @@ function createWebSocketProxy(ctx) {
clientHead,
};
ctx.config.requestMiddleware.forEach(fn => fn(requestContext));
(requestContext.url.protocol == 'https:' ? https : http).request({
((requestContext.url.protocol == 'https:' || ctx.config.forceHttps) ? https : http).request({
headers: requestContext.headers,
method: requestContext.method,
hostname: requestContext.url.hostname,