set default wisp server for static build

This commit is contained in:
velzie 2024-10-12 19:34:02 -04:00
parent f4bbc4db2c
commit 48fd39eca1
4 changed files with 10 additions and 22 deletions

View file

@ -11,3 +11,4 @@ cp -r assets/ $DST/assets
cp -r dist/ $DST/scram
cp -r static/* $DST
echo 'let _CONFIG = { wispurl: "wss://puter.cafe/", bareurl: "https://aluu.xyz/bare/" }' > $DST/config.js

0
static/config.js Normal file
View file

View file

@ -35,6 +35,7 @@
<script src="https://cdn.jsdelivr.net/npm/dreamland"></script>
<script src="/baremux/index.js" defer></script>
<script src="/scram/scramjet.controller.js"></script>
<script src="config.js"></script>
<script src="ui.js" defer></script>
</body>
</html>

View file

@ -10,22 +10,6 @@ const scramjet = new ScramjetController({
scramjet.init("./sw.js");
// navigator.serviceWorker.ready.then((reg) => {
// for (let i = 0; i < 20; i++) {
// const thread = new SharedWorker($scramjet.config.thread, {
// name: "thread" + i,
// });
//
// reg.active.postMessage(
// {
// scramjet$type: "add",
// handle: thread.port,
// },
// [thread.port]
// );
// }
// });
const connection = new BareMux.BareMuxConnection("/baremux/worker.js");
const flex = css`
display: flex;
@ -38,11 +22,13 @@ const store = $store(
{
url: "https://google.com",
wispurl:
_CONFIG?.wispurl ||
(location.protocol === "https:" ? "wss" : "ws") +
"://" +
location.host +
"/wisp/",
bareurl:
_CONFIG?.bareurl ||
(location.protocol === "https:" ? "https" : "http") +
"://" +
location.host +