Spaces:
Runtime error
Runtime error
Update index.js
Browse files
index.js
CHANGED
|
@@ -10,19 +10,17 @@ const { UI } = require('./NewBotStyle');
|
|
| 10 |
const { createLineupAttachment } = require('./lineupRenderer');
|
| 11 |
const { createProfileAttachment } = require('./profileRenderer');
|
| 12 |
|
| 13 |
-
//
|
| 14 |
-
//
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
const
|
| 18 |
-
process.env.NO_PROXY
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
delete process.env.https_proxy;
|
| 25 |
-
delete process.env.all_proxy;
|
| 26 |
|
| 27 |
// Network hijack can break Discord auth on some environments.
|
| 28 |
// Keep it opt-in via env when explicitly needed.
|
|
|
|
| 10 |
const { createLineupAttachment } = require('./lineupRenderer');
|
| 11 |
const { createProfileAttachment } = require('./profileRenderer');
|
| 12 |
|
| 13 |
+
// Proxy handling:
|
| 14 |
+
// Some hosts require proxy env vars for outbound internet.
|
| 15 |
+
// Only force Discord proxy bypass when explicitly requested.
|
| 16 |
+
if (process.env.BYPASS_PROXY_FOR_DISCORD === 'true') {
|
| 17 |
+
const noProxyHosts = ['discord.com', 'gateway.discord.gg', 'cdn.discord.com'];
|
| 18 |
+
const existingNoProxy = process.env.NO_PROXY || process.env.no_proxy || '';
|
| 19 |
+
const mergedNoProxy = [existingNoProxy, ...noProxyHosts].filter(Boolean).join(',');
|
| 20 |
+
process.env.NO_PROXY = mergedNoProxy;
|
| 21 |
+
process.env.no_proxy = mergedNoProxy;
|
| 22 |
+
console.log('[NETWORK] BYPASS_PROXY_FOR_DISCORD enabled.');
|
| 23 |
+
}
|
|
|
|
|
|
|
| 24 |
|
| 25 |
// Network hijack can break Discord auth on some environments.
|
| 26 |
// Keep it opt-in via env when explicitly needed.
|