Closed wudb closed 6 months ago
Can you share the code with the other framework that works? You mentioned this in https://t.me/grammyjs/236806
const TelegramBot = require('node-telegram-bot-api'); const agent = require('socks5-https-client/lib/Agent');
const bot = new TelegramBot(process.env.TELEGRAM_BOT_TOKEN, { polling: true, request: { agentClass: agent, agentOptions: { socksHost: process.env.PROXY_SOCKS5_HOST, socksPort: process.env.PROXY_SOCKS5_PORT }, // timeout: 300000 } });
The framework used here is node-telegram bot-api and socks5-https-client, it work.
Can you share the code with the other framework that works? You mentioned this in https://t.me/grammyjs/236806
See the code above, the development environment and agent are the same
I solved this problem myself, in the following code: const socksAgent = new SocksProxyAgent("socks5://127.0.0.1:7890"), just change socks5 to socks.
Oh wow, good job, i wouldn't have guessed that. Thanks for sharing the solution, I'll point future people here /cc @KnightNiwrem
Hi, I used grammy,but report error: HttpError: Network request for 'getMe' failed! my source code:
node version: v20.3.1
The same error is reported whether the proxy is set or not.