Open atomexpert opened 2 years ago
In general, the problem turned out to be in data centers. Each number has its own region, and depending on it, Telegram allocates a specific Data Center. And unfortunately not every proxy ipV6 can connect to this DC.
Hello! Unfortunately, the library does not work correctly with Ipv6 proxy. I kindly ask you to help me to solve this problem.
The crux of the problem is this:
WebSocket connection failed
.Auth key unset
Data centers that I have tried:
But in the end the error was the same as described above.
I used different proxies, checked them in the desktop version of telegram - they all work fine. If anyone has any solution, I would be very grateful if you share it.
Code I used (with working proxy):
const { Api, TelegramClient } = require("telegram");
const { StringSession } = require("telegram/sessions");
const input = require("input");
const apiId = 1;
const apiHash = "b6b154c3707471f5339bd661645ed3d6";
const session = new StringSession("");
const client = new TelegramClient(session, apiId, apiHash, {
connectionRetries: 2,
useIPV6: true,
langCode: 'en',
systemLangCode: 'en',
proxy: {
ip: "45.89.19.41",
port: 7711,
username: "FFhf0l",
password: "bBlM1c6JSG",
MTProxy: false,
socksType: 5,
timeout: 20,
}
})
let start = async()=>{
await client.connect()
.then(response => {
console.log("Connect");
})
.catch(error => {
console.log("Error: "+error);
})
}
start();