shim plugin related APIs, proxy web requests.

This commit is contained in:
Nystik
2026-03-11 23:03:14 +01:00
parent 9789be6d70
commit ac41ac3c4e
10 changed files with 452 additions and 0 deletions

19
shims/node/net.js Normal file
View File

@@ -0,0 +1,19 @@
function notAvailable(name) {
return function () {
throw new Error(`net.${name}() is not available in the web version.`);
};
}
export const createServer = notAvailable("createServer");
export const createConnection = notAvailable("createConnection");
export const connect = notAvailable("connect");
export class Socket {
constructor() {
throw new Error("net.Socket is not available in the web version.");
}
}
export class Server {
constructor() {
throw new Error("net.Server is not available in the web version.");
}
}