mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
shim plugin related APIs, proxy web requests.
This commit is contained in:
19
shims/node/net.js
Normal file
19
shims/node/net.js
Normal 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.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user