Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy Socks5 doesnt work #730

Open
Vance-ng-vn opened this issue Oct 7, 2024 · 3 comments
Open

Proxy Socks5 doesnt work #730

Vance-ng-vn opened this issue Oct 7, 2024 · 3 comments

Comments

@Vance-ng-vn
Copy link

image

Is there a solution?

@zugelman
Copy link

zugelman commented Oct 11, 2024

If you examine the files PromisedNetSockets.js , TCPMTProxy.ts we will see that for socks5 we do not need the 'MTProxy' and 'secret' fields. Just delete them. Here is my working example:

const client = new TelegramClient(storeSession, apiId, apiHash, {
      connectionRetries: 5,
      useWSS: false,
      proxy: {
        ip: "0.0.0.0",
        port: 999, 
        username: "xxx",
        password: "xxx",
        socksType: 5,
        timeout: 2,
      }      
    });

@Vance-ng-vn
Copy link
Author

If you examine the files PromisedNetSockets.js , TCPMTProxy.ts we will see that for socks5 we do not need the 'MTProxy' and 'secret' fields. Just delete them. Here is my working example:

const client = new TelegramClient(storeSession, apiId, apiHash, {
      connectionRetries: 5,
      useWSS: false,
      proxy: {
        ip: "0.0.0.0",
        port: 999, 
        username: "xxx",
        password: "xxx",
        socksType: 5,
        timeout: 2,
      }      
    });

image
I noticed that gramjs login into the proxy but then immediately disconnects and uses my real IP ...

@bitk0der
Copy link

If you examine the files PromisedNetSockets.js , TCPMTProxy.ts we will see that for socks5 we do not need the 'MTProxy' and 'secret' fields. Just delete them. Here is my working example:

const client = new TelegramClient(storeSession, apiId, apiHash, {
      connectionRetries: 5,
      useWSS: false,
      proxy: {
        ip: "0.0.0.0",
        port: 999, 
        username: "xxx",
        password: "xxx",
        socksType: 5,
        timeout: 2,
      }      
    });

image I noticed that gramjs login into the proxy but then immediately disconnects and uses my real IP ...

It's not your IP, it's Telegram DC, if you look at your logs, it's says "Reconnecting to new data center ...". There is no any information about your IP in logs, only about Telegram IPs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants