Skip to content

Commit

Permalink
👷 build: add ENABLE_PROXY_DNS env (lobehub#6690)
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhijie0327 authored Mar 4, 2025
1 parent 71a638e commit eb6b0b2
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions scripts/serverLauncher/startServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,24 @@ const runProxyChainsConfGenerator = async (url) => {

let ip = isValidIP(host, 4) ? host : await resolveHostIP(host, 4);

const configContent = `
localnet 127.0.0.0/255.0.0.0
localnet 10.0.0.0/255.0.0.0
localnet 172.16.0.0/255.240.0.0
localnet 192.168.0.0/255.255.0.0
localnet ::1/128
const proxyDNSConfig = process.env.ENABLE_PROXY_DNS === '1' ? `
proxy_dns
remote_dns_subnet 224
`.trim() : '';

const configContent = `
localnet 127.0.0.0/8
localnet 10.0.0.0/8
localnet 172.16.0.0/12
localnet 192.168.0.0/16
localnet ::/127
${proxyDNSConfig}
strict_chain
tcp_connect_time_out 8000
tcp_read_time_out 15000
[ProxyList]
${protocol} ${ip} ${port} ${user} ${pass}
`.trim();
`.replace(/\n{2,}/g, '\n').trim();

await fs.writeFile(PROXYCHAINS_CONF_PATH, configContent);
console.log(`✅ ProxyChains: All outgoing traffic routed via ${url}.`);
Expand Down

0 comments on commit eb6b0b2

Please sign in to comment.