mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
set default wisp server for static build
This commit is contained in:
parent
f4bbc4db2c
commit
48fd39eca1
4 changed files with 10 additions and 22 deletions
|
@ -11,3 +11,4 @@ cp -r assets/ $DST/assets
|
||||||
cp -r dist/ $DST/scram
|
cp -r dist/ $DST/scram
|
||||||
cp -r static/* $DST
|
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
0
static/config.js
Normal file
|
@ -35,6 +35,7 @@
|
||||||
<script src="https://cdn.jsdelivr.net/npm/dreamland"></script>
|
<script src="https://cdn.jsdelivr.net/npm/dreamland"></script>
|
||||||
<script src="/baremux/index.js" defer></script>
|
<script src="/baremux/index.js" defer></script>
|
||||||
<script src="/scram/scramjet.controller.js"></script>
|
<script src="/scram/scramjet.controller.js"></script>
|
||||||
|
<script src="config.js"></script>
|
||||||
<script src="ui.js" defer></script>
|
<script src="ui.js" defer></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
30
static/ui.js
30
static/ui.js
|
@ -10,22 +10,6 @@ const scramjet = new ScramjetController({
|
||||||
|
|
||||||
scramjet.init("./sw.js");
|
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 connection = new BareMux.BareMuxConnection("/baremux/worker.js");
|
||||||
const flex = css`
|
const flex = css`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -38,15 +22,17 @@ const store = $store(
|
||||||
{
|
{
|
||||||
url: "https://google.com",
|
url: "https://google.com",
|
||||||
wispurl:
|
wispurl:
|
||||||
|
_CONFIG?.wispurl ||
|
||||||
(location.protocol === "https:" ? "wss" : "ws") +
|
(location.protocol === "https:" ? "wss" : "ws") +
|
||||||
"://" +
|
"://" +
|
||||||
location.host +
|
location.host +
|
||||||
"/wisp/",
|
"/wisp/",
|
||||||
bareurl:
|
bareurl:
|
||||||
|
_CONFIG?.bareurl ||
|
||||||
(location.protocol === "https:" ? "https" : "http") +
|
(location.protocol === "https:" ? "https" : "http") +
|
||||||
"://" +
|
"://" +
|
||||||
location.host +
|
location.host +
|
||||||
"/bare/",
|
"/bare/",
|
||||||
proxy: "",
|
proxy: "",
|
||||||
},
|
},
|
||||||
{ ident: "settings", backing: "localstorage", autosave: "auto" }
|
{ ident: "settings", backing: "localstorage", autosave: "auto" }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue