telegram-shop-api / src /utils /telegramAgent.js
Deploy Bot
Fix Telegram Proxy for Images & Update User Model
8202ff6
raw
history blame contribute delete
548 Bytes
const https = require('https');
const dns = require('dns');
// Custom Agent with IP hardcoded to bypass DNS issues on Hugging Face
const telegramAgent = new https.Agent({
keepAlive: true,
family: 4,
lookup: (hostname, options, callback) => {
if (hostname === 'api.telegram.org') {
console.log('⚡ Agent using hardcoded IP for Telegram: 149.154.166.110');
return callback(null, '149.154.166.110', 4);
}
dns.lookup(hostname, options, callback);
}
});
module.exports = telegramAgent;