This commit is contained in:
MotorTruck1221 2024-03-06 01:14:00 -07:00
parent af88c5475b
commit 69823802f5
No known key found for this signature in database
GPG key ID: 06901A625432AC21
3 changed files with 18 additions and 7 deletions

View file

@ -3,7 +3,6 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="/mux/bare.cjs" defer></script>
<script src="/epoxy/index.js" defer></script> <script src="/epoxy/index.js" defer></script>
<script src="/uv/uv.bundle.js" defer></script> <script src="/uv/uv.bundle.js" defer></script>
<script src="/uv/uv.config.js" defer></script> <script src="/uv/uv.config.js" defer></script>

View file

@ -15,14 +15,26 @@ function changeTransport(transport: string, wispUrl: string) {
SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl }); SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl });
break; break;
//libcurl when supported can be easily added here //libcurl when supported can be easily added here
//and stuff like bare-as-module3 COULD also be added
default: default:
SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl }); SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl });
break; break;
} }
} }
function getTransport() {
return localStorage.getItem("transport") || "epoxy";
}
function restartTransport() {
changeTransport(getTransport(), localStorage.getItem("wispUrl") || (location.protocol === "https:" ? "wss://" : "ws://") + location.host + "/wisp/");
}
//restart transport every minute
setInterval(restartTransport, 60000); //60000ms = 60s = 1m
const wispUrl = (location.protocol === "https:" ? "wss://" : "ws://") + location.host + "/wisp/"; const wispUrl = (location.protocol === "https:" ? "wss://" : "ws://") + location.host + "/wisp/";
registerRemoteListener(navigator.serviceWorker.controller!); registerRemoteListener(navigator.serviceWorker.controller!);
changeTransport(localStorage.getItem("transport") || "epoxy", localStorage.getItem("wispUrl") || wispUrl); changeTransport(localStorage.getItem("transport") || "epoxy", localStorage.getItem("wispUrl") || wispUrl);
export { changeTransport }; export { changeTransport, getTransport };

View file

@ -19,11 +19,11 @@ export default defineConfig({
dest: "uv", dest: "uv",
overwrite: false overwrite: false
}, },
{ //{
src: `${baremuxPath}/**/*`.replace(/\\/g, "/"), // src: `${baremuxPath}/**/*`.replace(/\\/g, "/"),
dest: "mux", // dest: "mux",
overwrite: false // overwrite: false
}, //},
{ {
//include ALL files types //include ALL files types
src: `${epoxyPath}/**/*`, src: `${epoxyPath}/**/*`,