-
Notifications
You must be signed in to change notification settings - Fork 759
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
771efbf
commit dd20dbf
Showing
5 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
if ('serviceWorker' in navigator) { | ||
await navigator.serviceWorker.register('/sw.js', { | ||
scope: '/sw/', | ||
}).then(() => updateTransports()); | ||
}).then(updateTransport); | ||
|
||
await navigator.serviceWorker.register('/dynsw.js', { | ||
scope: '/dyn/', | ||
|
@@ -36,15 +36,16 @@ | |
|
||
async function updateTransports() { | ||
BareMux.registerRemoteListener(navigator.serviceWorker.controller); | ||
let transport = localStorage.getItem('transport') || "EpxMod.EpoxyClient" | ||
if (window.location.origin.includes('.pages.dev')) { | ||
console.log('your static hosting, using TOMP Wisp Server.') | ||
let wispserver = "wss://tomp.app/wisp" | ||
BareMux.SetTransport("CurlMod.LibcurlClient", { wisp: wispserver, wasm: "https://cdn.jsdelivr.net/npm/[email protected]/libcurl.wasm" }); | ||
BareMux.SetTransport(transport, { wisp: wispserver }); | ||
} else { | ||
console.log('Using Backend Wisp Server, if your static hosting just delete these lines bellow and uncomment out the text bellow') | ||
//let wispserver = "wss://tomp.app/wisp" Uncomment if static hosting | ||
let wispserver = `${window.location.origin.replace(/^https?:\/\//, 'ws://')}/wisp/` | ||
BareMux.SetTransport("CurlMod.LibcurlClient", { wisp: wispserver, wasm: "https://cdn.jsdelivr.net/npm/[email protected]/libcurl.wasm" }); | ||
BareMux.SetTransport(transport, { wisp: wispserver }); | ||
} | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters