mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 20:12:52 +08:00
feat: add GitHub skin store and organize instance administration
Adopt the pinned published TeamSpeak SDK and direct relay routing. Add optional TeamSpeak Query administration with encrypted credentials and separate WebSpeak access, site, operations and skin management. Distribute Discord Voice through the GitHub skin index, preserve skin state during updates, and correct KAAK scaling and screen fullscreen. Validation: 831 tests; backend and frontend builds; five-language UI checks from narrow screens through 4K and local Query fixture actions.
This commit is contained in:
1 parent
180bfeb52f
commit
0af3236c30
95 files changed
+7678
-709
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { request as httpRequest } from "node:http";
|
||||
import { request as httpsRequest } from "node:https";
|
||||
|
||||
/** Keep the SDK's WebQuery protocol, but bound HTTP requests to this admin operation.
|
||||
* Node's global fetch blocks WebQuery's default port 10080. */
|
||||
export function webQueryFetch(lifetime: AbortSignal): typeof fetch {
|
||||
return ((url: string, init: RequestInit) => new Promise<Response>((resolve, reject) => {
|
||||
const request = new URL(url).protocol === "https:" ? httpsRequest : httpRequest;
|
||||
const req = request(url, {
|
||||
method: init.method, headers: init.headers as Record<string, string>,
|
||||
signal: AbortSignal.any([lifetime, AbortSignal.timeout(8_000)]),
|
||||
}, res => {
|
||||
const chunks: Buffer[] = [];
|
||||
let size = 0;
|
||||
res.on("data", (chunk: Buffer) => {
|
||||
size += chunk.length;
|
||||
if (size > 8 * 1024 * 1024) { res.destroy(new Error("WebQuery response too large")); return; }
|
||||
chunks.push(chunk);
|
||||
});
|
||||
res.on("error", reject);
|
||||
res.on("end", () => resolve(new Response(Buffer.concat(chunks), {
|
||||
status: res.statusCode ?? 502, statusText: res.statusMessage ?? "",
|
||||
})));
|
||||
});
|
||||
req.on("error", reject);
|
||||
req.end(init.body as string);
|
||||
})) as typeof fetch;
|
||||
}
|
||||
Reference in new issue
Block a user