From f059c83596bb17701ee73185c0a85616f6a7556f Mon Sep 17 00:00:00 2001
From: Entrpix
Date: Sun, 7 Jul 2024 22:18:52 -0400
Subject: [PATCH] fix things. libreddit, searxng coming soon :tm:
---
.gitmodules | 6 +++-
src/config.json | 2 +-
src/server.mjs | 6 ++++
views/assets/js/common-16451543478.js | 38 +++++++++++++------------
views/assets/js/register-sw.js | 35 +++++++++++++----------
views/pages/frame.html | 1 -
views/pages/nav/games5.html | 5 ++++
views/pages/proxnav/corrosion.html | 5 ++++
views/pages/proxnav/preset/discord.html | 3 +-
views/pages/proxnav/preset/reddit.html | 11 ++++---
views/pages/proxnav/preset/spotify.html | 11 ++++---
views/pages/proxnav/preset/youtube.html | 11 ++++---
views/pages/proxnav/ultraviolet.html | 19 -------------
13 files changed, 78 insertions(+), 75 deletions(-)
diff --git a/.gitmodules b/.gitmodules
index a83a9d92..8b391333 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,7 @@
[submodule "views/archive"]
path = views/archive
- url = https://github.com/QuiteAFancyEmerald/HU-Archive.git
\ No newline at end of file
+ url = https://github.com/QuiteAFancyEmerald/HU-Archive.git
+
+[submodule "views/archive/osu"]
+ path = views/archive/osu
+ url = https://github.com/BlaNKtext/webosu.git
\ No newline at end of file
diff --git a/src/config.json b/src/config.json
index de8279bc..8e31f201 100644
--- a/src/config.json
+++ b/src/config.json
@@ -1,6 +1,6 @@
{
"title": "HU OSS",
- "port": "8080",
+ "port": "8081",
"ssl": false,
"ws": true,
"prefix": "/service/",
diff --git a/src/server.mjs b/src/server.mjs
index 0d4e3073..5f002700 100644
--- a/src/server.mjs
+++ b/src/server.mjs
@@ -22,6 +22,12 @@ const router = express.Router();
const bare = createBareServer('/bare/');
const rh = createRammerhead();
+app.get('/baremux/bare.cjs', (req, res) => {
+ res.setHeader('Content-Type', 'application/javascript');
+ res.sendFile(path.join(baremuxPath, 'bare.cjs'));
+});
+
+
const rammerheadScopes = [
'/rammerhead.js',
'/hammerhead.js',
diff --git a/views/assets/js/common-16451543478.js b/views/assets/js/common-16451543478.js
index dba78438..301b0982 100644
--- a/views/assets/js/common-16451543478.js
+++ b/views/assets/js/common-16451543478.js
@@ -59,9 +59,6 @@ const xor = {
},
};
-const stockSW = "/uv/sw.js";
-const swAllowedHostnames = ["localhost", "127.0.0.1"];
-
/* To use:
* goProx.proxy(url-string, stealth-boolean-optional)
*
@@ -268,18 +265,23 @@ async function RammerheadEncode(baseUrl) {
});
}
+function uvUrl(url) {
+ return location.origin + __uv$config.prefix + __uv$config.encodeUrl(url);
+};
+
window.goProx = {
+ // `location.protocol + "//" + getDomain()` more like `location.origin`
ultraviolet: function (url, stealth) {
setAuthCookie("__cor_auth=1", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl(omnibox(url)), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl(omnibox(url)), stealth);
},
womginx: function (url, stealth) {
setAuthCookie("wgauth=yes", false);
goToUrl(location.protocol + "//a." + getDomain() + "/main/" + omnibox(url), stealth);
},
rammerhead: async function (url, stealth) {
- goToUrl(location.protocol + "//" + getDomain() + await RammerheadEncode(omnibox(url)), stealth);
- }, // i spent like 20 mins just to realize i had to make it async
+ goToUrl(location.origin + await RammerheadEncode(omnibox(url)), stealth);
+ },
searx: function (stealth) {
setAuthCookie("oldsmobile=badcar", false);
goToUrl(location.protocol + "//c." + getDomain() + "/engine/", stealth);
@@ -293,50 +295,50 @@ window.goProx = {
},
osu: function (stealth) {
setAuthCookie("osauth=true", false);
- goToUrl(location.protocol + "//osu." + getDomain() + "/index.html", stealth);
+ goToUrl(location.origin + '/archive/osu', stealth);
},
mcnow: function (stealth) {
setAuthCookie("__cor_auth=1", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/mojang/2534/minecraft-trial'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/mojang/2534/minecraft-trial'), stealth);
},
glife: function (stealth) {
setAuthCookie("__cor_auth=1", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/lunime/5767/gacha-life'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/lunime/5767/gacha-life'), stealth);
},
roblox: function (stealth) {
setAuthCookie("__cor_auth=1", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/roblox-corporation/5349/roblox'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/roblox-corporation/5349/roblox'), stealth);
},
amongus: function (stealth) {
setAuthCookie("__cor_auth=1", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/innersloth-llc/4047/among-us'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/innersloth-llc/4047/among-us'), stealth);
},
pubg: function (stealth) {
setAuthCookie("__cor_auth=1", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/proxima-beta/2609/pubg-mobile-resistance'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('https://now.gg/play/proxima-beta/2609/pubg-mobile-resistance'), stealth);
},
train: function (stealth) {
setAuthCookie("wgauth=yes", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('v6p9' + 'd9t4.ssl.hw' + 'cdn.net/html/1970' + '387/index.ht' + 'ml'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('v6p9' + 'd9t4.ssl.hw' + 'cdn.net/html/1970' + '387/index.ht' + 'ml'), stealth);
},
village: function (stealth) {
setAuthCookie("wgauth=yes", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('v6p' + '9d9t4.ss' + 'l.hwcd' + 'n.net/html/3' + '626475/index.html'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('v6p' + '9d9t4.ss' + 'l.hwcd' + 'n.net/html/3' + '626475/index.html'), stealth);
},
prison: function (stealth) {
setAuthCookie("wgauth=yes", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('v6p' + '9d9t4.ssl.hwc' + 'dn.net/h' + 'tml/364' + '7099/index.html'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('v6p' + '9d9t4.ssl.hwc' + 'dn.net/h' + 'tml/364' + '7099/index.html'), stealth);
},
rpg: function (stealth) {
setAuthCookie("wgauth=yes", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('v6p9d9' + 't4.ssl.hwc' + 'dn.net/html/347' + '0524/Die%20in%20the%20Du' + 'ngeon%201.1%20[WEB]/index.html'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('v6p9d9' + 't4.ssl.hwc' + 'dn.net/html/347' + '0524/Die%20in%20the%20Du' + 'ngeon%201.1%20[WEB]/index.html'), stealth);
},
speed: function (stealth) {
setAuthCookie("wgauth=yes", false);
- goToUrl(location.protocol + "//" + getDomain() + __uv$config.prefix + __uv$config.encodeUrl('v6p9' + 'd9t4.ssl.hw' + 'cdn.net/html/36' + '28752/index.html'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('v6p9' + 'd9t4.ssl.hw' + 'cdn.net/html/36' + '28752/index.html'), stealth);
},
heli: function (stealth) {
setAuthCookie("wgauth=yes", false);
- goToUrl(location.protocol + "//" + __uv$config.prefix + __uv$config.encodeUrl('v6p9d' + '9t4.ssl.h' + 'wcdn.net/ht' + 'ml/3605' + '579/Helo%20Sto' + 'rm/index.html'), stealth);
+ goToUrl(location.origin + __uv$config.prefix + __uv$config.encodeUrl('v6p9d' + '9t4.ssl.h' + 'wcdn.net/ht' + 'ml/3605' + '579/Helo%20Sto' + 'rm/index.html'), stealth);
}
};
\ No newline at end of file
diff --git a/views/assets/js/register-sw.js b/views/assets/js/register-sw.js
index a3beb0c3..54a8be92 100644
--- a/views/assets/js/register-sw.js
+++ b/views/assets/js/register-sw.js
@@ -1,16 +1,21 @@
+const stockSW = "/uv/sw.js";
+const swAllowedHostnames = ["localhost", "127.0.0.1"];
+
async function registerSW() {
- if (!navigator.serviceWorker) {
- if (
- location.protocol !== "https:" &&
- !swAllowedHostnames.includes(location.hostname)
- )
- throw new Error("Service workers cannot be registered without https.");
-
- throw new Error("Your browser doesn't support service workers.");
- }
-
- await navigator.serviceWorker.register(stockSW);
-
- let wispUrl = (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/";
- await BareMux.SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl });
- }
\ No newline at end of file
+ if (!navigator.serviceWorker) {
+ if (
+ location.protocol !== "https:" &&
+ !swAllowedHostnames.includes(location.hostname)
+ )
+ throw new Error("Service workers cannot be registered without https.");
+
+ throw new Error("Your browser doesn't support service workers.");
+ }
+
+ await navigator.serviceWorker.register(stockSW);
+
+ let wispUrl = (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/";
+ await BareMux.SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl });
+}
+
+registerSW();
\ No newline at end of file
diff --git a/views/pages/frame.html b/views/pages/frame.html
index fa294359..2986e4b6 100644
--- a/views/pages/frame.html
+++ b/views/pages/frame.html
@@ -17,7 +17,6 @@
-
diff --git a/views/pages/nav/games5.html b/views/pages/nav/games5.html
index 57df9991..a36d6cbb 100644
--- a/views/pages/nav/games5.html
+++ b/views/pages/nav/games5.html
@@ -12,6 +12,11 @@
+
+
+
+
+
diff --git a/views/pages/proxnav/corrosion.html b/views/pages/proxnav/corrosion.html
index 80e41f8a..e39eab85 100644
--- a/views/pages/proxnav/corrosion.html
+++ b/views/pages/proxnav/corrosion.html
@@ -18,6 +18,11 @@
+
+
+
+
+
diff --git a/views/pages/proxnav/preset/discord.html b/views/pages/proxnav/preset/discord.html
index 7fbf8d39..b8b8c596 100644
--- a/views/pages/proxnav/preset/discord.html
+++ b/views/pages/proxnav/preset/discord.html
@@ -17,7 +17,6 @@
-
@@ -64,8 +63,8 @@
-
+
diff --git a/views/pages/proxnav/preset/reddit.html b/views/pages/proxnav/preset/reddit.html
index 1a608ac8..c6e00d3e 100644
--- a/views/pages/proxnav/preset/reddit.html
+++ b/views/pages/proxnav/preset/reddit.html
@@ -12,6 +12,11 @@
+
+
+
+
+
@@ -46,12 +51,6 @@
-
-
-
-
@@ -45,12 +50,6 @@
-
-
-
-
@@ -45,12 +50,6 @@
-
-
-
-