diff --git a/app.json b/app.json index 03207ff0..ecf57956 100644 --- a/app.json +++ b/app.json @@ -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"] +} \ No newline at end of file diff --git a/backend.js b/backend.js index 0c85c732..0eb80d06 100644 --- a/backend.js +++ b/backend.js @@ -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.'), ], diff --git a/src/lib/browser/document.js b/lib/browser/document.js similarity index 100% rename from src/lib/browser/document.js rename to lib/browser/document.js diff --git a/src/lib/browser/history.js b/lib/browser/history.js similarity index 100% rename from src/lib/browser/history.js rename to lib/browser/history.js diff --git a/src/lib/browser/http.js b/lib/browser/http.js similarity index 100% rename from src/lib/browser/http.js rename to lib/browser/http.js diff --git a/src/lib/browser/index.js b/lib/browser/index.js similarity index 100% rename from src/lib/browser/index.js rename to lib/browser/index.js diff --git a/src/lib/browser/location.js b/lib/browser/location.js similarity index 100% rename from src/lib/browser/location.js rename to lib/browser/location.js diff --git a/src/lib/browser/worker.js b/lib/browser/worker.js similarity index 100% rename from src/lib/browser/worker.js rename to lib/browser/worker.js diff --git a/src/lib/codec.js b/lib/codec.js similarity index 100% rename from src/lib/codec.js rename to lib/codec.js diff --git a/src/lib/cookie-parser.js b/lib/cookie-parser.js similarity index 100% rename from src/lib/cookie-parser.js rename to lib/cookie-parser.js diff --git a/src/lib/cookie.js b/lib/cookie.js similarity index 100% rename from src/lib/cookie.js rename to lib/cookie.js diff --git a/src/lib/css.js b/lib/css.js similarity index 100% rename from src/lib/css.js rename to lib/css.js diff --git a/src/lib/esotope.js b/lib/esotope.js similarity index 100% rename from src/lib/esotope.js rename to lib/esotope.js diff --git a/src/lib/html.js b/lib/html.js similarity index 100% rename from src/lib/html.js rename to lib/html.js diff --git a/src/lib/js.js b/lib/js.js similarity index 100% rename from src/lib/js.js rename to lib/js.js diff --git a/src/lib/rewrite.js b/lib/rewrite.js similarity index 95% rename from src/lib/rewrite.js rename to lib/rewrite.js index eb326de6..0c981f28 100644 --- a/src/lib/rewrite.js +++ b/lib/rewrite.js @@ -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); diff --git a/src/lib/server/decompress.js b/lib/server/decompress.js similarity index 100% rename from src/lib/server/decompress.js rename to lib/server/decompress.js diff --git a/src/lib/server/gateway.js b/lib/server/gateway.js similarity index 100% rename from src/lib/server/gateway.js rename to lib/server/gateway.js diff --git a/src/lib/server/headers.js b/lib/server/headers.js similarity index 100% rename from src/lib/server/headers.js rename to lib/server/headers.js diff --git a/src/lib/server/index.js b/lib/server/index.js similarity index 98% rename from src/lib/server/index.js rename to lib/server/index.js index 0d752c71..6d165fe5 100644 --- a/src/lib/server/index.js +++ b/lib/server/index.js @@ -13,6 +13,7 @@ const fs = require('fs'); const defaultConfig = { prefix: '/service/', codec: 'plain', + forceHttps: false, ws: true, cookie: true, title: 'Service', diff --git a/src/lib/server/middleware.js b/lib/server/middleware.js similarity index 100% rename from src/lib/server/middleware.js rename to lib/server/middleware.js diff --git a/src/lib/server/request.js b/lib/server/request.js similarity index 90% rename from src/lib/server/request.js rename to lib/server/request.js index dbb4abbd..89495fce 100644 --- a/src/lib/server/request.js +++ b/lib/server/request.js @@ -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, diff --git a/src/lib/server/rewrite-body.js b/lib/server/rewrite-body.js similarity index 100% rename from src/lib/server/rewrite-body.js rename to lib/server/rewrite-body.js diff --git a/src/lib/server/upgrade.js b/lib/server/upgrade.js similarity index 91% rename from src/lib/server/upgrade.js rename to lib/server/upgrade.js index 1f5658d8..81a1a053 100644 --- a/src/lib/server/upgrade.js +++ b/lib/server/upgrade.js @@ -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, diff --git a/src/lib/url.js b/lib/url.js similarity index 100% rename from src/lib/url.js rename to lib/url.js