Finalize adding bare server as a transport

This commit is contained in:
MotorTruck1221 2024-03-10 03:54:57 -06:00
parent a3094b3923
commit df25d7882d
No known key found for this signature in database
GPG key ID: 06901A625432AC21
2 changed files with 9 additions and 8 deletions

View file

@ -35,7 +35,8 @@ const Proxy = ({ id, active }) => {
"/wisp/"; "/wisp/";
const transports = [ const transports = [
{ id: "epoxy", label: "Epoxy" }, { id: "epoxy", label: "Epoxy" },
{ id: "libcurl", label: "Libcurl" } { id: "libcurl", label: "Libcurl" },
{ id: "bare", label: "Bare Server" }
]; ];
return ( return (

View file

@ -3,13 +3,6 @@ import {
registerRemoteListener registerRemoteListener
} from "@mercuryworkshop/bare-mux"; } from "@mercuryworkshop/bare-mux";
declare global {
interface Window {
BareMux: any;
p: any;
}
}
function changeTransport(transport: string, wispUrl: string) { function changeTransport(transport: string, wispUrl: string) {
switch (transport) { switch (transport) {
case "epoxy": case "epoxy":
@ -25,6 +18,13 @@ function changeTransport(transport: string, wispUrl: string) {
wasm: "/libcurl.wasm" wasm: "/libcurl.wasm"
}); });
break; break;
case "bare":
localStorage.setItem("transport", "bare");
console.log("Setting transport to Bare");
const bare = localStorage.getItem("bare") || window.location.origin + "/bare/";
console.log("Bare URL: " + bare);
SetTransport("BareMod.BareClient", bare);
break;
//stuff like bare-as-module3 COULD also be added //stuff like bare-as-module3 COULD also be added
default: default:
SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl }); SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl });