nsite-ts/src/proxy.ts

14 lines
345 B
TypeScript
Raw Normal View History

2024-10-01 12:28:34 -05:00
import { ProxyAgent } from "proxy-agent";
import { getProxyForUrl } from "proxy-from-env";
const agent = new ProxyAgent({ keepAlive: true });
if (getProxyForUrl("http://example.onion")) {
console.log("Tor connections enabled");
}
if (getProxyForUrl("http://example.i2p")) {
console.log("I2P connections enabled");
}
export default agent;