mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
add built in wisp server
This commit is contained in:
parent
084f2cd789
commit
3ced0defc4
4 changed files with 1611 additions and 3453 deletions
|
@ -56,6 +56,7 @@
|
|||
"domutils": "^3.1.0",
|
||||
"htmlparser2": "^9.1.0",
|
||||
"meriyah": "^4.4.2",
|
||||
"parse-domain": "^8.0.2"
|
||||
"parse-domain": "^8.0.2",
|
||||
"wisp-server-node": "^1.1.1"
|
||||
}
|
||||
}
|
||||
|
|
4998
pnpm-lock.yaml
generated
4998
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
@ -6,6 +6,7 @@ import fastifyStatic from "@fastify/static";
|
|||
import { join } from "node:path";
|
||||
import { spawn } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import wisp from "wisp-server-node";
|
||||
|
||||
//transports
|
||||
import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
|
||||
|
@ -32,7 +33,7 @@ const fastify = Fastify({
|
|||
if (bare.shouldRoute(req)) {
|
||||
bare.routeUpgrade(req, socket, head);
|
||||
} else {
|
||||
socket.end();
|
||||
wisp.routeRequest(req, socket, head);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -28,7 +28,7 @@ const col = css`
|
|||
const store = $store(
|
||||
{
|
||||
url: "https://google.com",
|
||||
wispurl: "wss://wisp.mercurywork.shop/",
|
||||
wispurl: (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/",
|
||||
bareurl:
|
||||
(location.protocol === "https:" ? "https" : "http") +
|
||||
"://" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue