Scott-778/coinmarketcap-sniper-bot

[ERROR] - [WebSocket connection failed attempt: 1]

Molers opened this issue · 2 comments

Describe the bug
Telegram is banned in China, so I used V2RayN as a proxy, but it still didn't work.
Additional context
Add any other context about the problem here.
1670664330(1)

I fix it.

gram-js/gramjs#128

https://gram.js.org/getting-started/authorization#using-mtproxies-and-socks5-proxies

image

const { TelegramClient } = require("telegram");

const apiId = 123456;
const apiHash = "123456abcdfg";

(async () => {
console.log("Loading interactive example...");
const client = new TelegramClient("session_name", apiId, apiHash, {
useWSS: false, // Important. Most proxies cannot use SSL.
proxy: {
ip: "123.123.123.123", // Proxy host (IP or hostname)
port: 123, // Proxy port
MTProxy: false, // Whether it's an MTProxy or a normal Socks one
secret: "00000000000000000000000000000000", // If used MTProxy then you need to provide a secret (or zeros).
socksType: 5, // If used Socks you can choose 4 or 5.
timeout: 2, // Timeout (in seconds) for connection,
},
});
await client.connect();
console.log("You should now be connected.");
})();

any progress ?!