READ-ONLY PACKAGE PREVIEW

astro-developer/examples/deny_network.mjs

Version 28e74103fe3d.bb1 · MIT. This preview displays packaged text and does not execute code. Treat the contents as untrusted instructions.

← Return to resource and package checksum

import http from 'node:http';
import https from 'node:https';
import net from 'node:net';
import tls from 'node:tls';
import {syncBuiltinESMExports} from 'node:module';
globalThis.__bbNetworkAttempts = 0;
const denied = () => { globalThis.__bbNetworkAttempts++; throw new Error('Network denied by independent BB Skills fixture'); };
globalThis.fetch = denied;
http.request = http.get = https.request = https.get = denied;
net.Socket.prototype.connect = tls.connect = denied;
syncBuiltinESMExports();