add built in wisp server

This commit is contained in:
Percs 2024-07-19 16:14:43 -05:00
parent 084f2cd789
commit 3ced0defc4
4 changed files with 1611 additions and 3453 deletions

View file

@ -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

File diff suppressed because it is too large Load diff

View file

@ -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);
}
});
},

View file

@ -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") +
"://" +