Finalize adding bare server as a transport
This commit is contained in:
parent
a3094b3923
commit
df25d7882d
2 changed files with 9 additions and 8 deletions
|
|
@ -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 (
|
||||||
|
|
|
||||||
|
|
@ -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 });
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue