mirror of
https://github.com/hzrd149/nsite-gateway.git
synced 2025-06-23 20:05:03 +00:00
14 lines
345 B
TypeScript
14 lines
345 B
TypeScript
![]() |
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;
|