Skip to content

Commit

Permalink
set default wisp server for static build
Browse files Browse the repository at this point in the history
  • Loading branch information
velzie committed Oct 12, 2024
1 parent f4bbc4d commit 48fd39e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
1 change: 1 addition & 0 deletions buildstatic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file added static/config.js
Empty file.
1 change: 1 addition & 0 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
30 changes: 8 additions & 22 deletions static/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,15 +22,17 @@ const store = $store(
{
url: "https://google.com",
wispurl:
_CONFIG?.wispurl ||
(location.protocol === "https:" ? "wss" : "ws") +
"://" +
location.host +
"/wisp/",
"://" +
location.host +
"/wisp/",
bareurl:
_CONFIG?.bareurl ||
(location.protocol === "https:" ? "https" : "http") +
"://" +
location.host +
"/bare/",
"://" +
location.host +
"/bare/",
proxy: "",
},
{ ident: "settings", backing: "localstorage", autosave: "auto" }
Expand Down

0 comments on commit 48fd39e

Please sign in to comment.