alexbers / mtprotoproxy

Async MTProto proxy for Telegram
MIT License
1.59k stars 349 forks source link

Can't upload images/videos in certain ISP's. others work perfectly #90

Open masoudelete opened 5 years ago

masoudelete commented 5 years ago

I'm using the digital ocean server located in Germany, Ubuntu and my clients are in Iran.

everything works perfectly on all devices and different telegram apps

but 2 ISP's somehow can block uploading images and videos. the ISP's are (Irancell and Mobinnet)

I have the same issue with official telegram MTproxy and I created an issue there but I prefer using alexbers

erfantkerfan commented 5 years ago

I had that problem I could not upload image | video | voice in some ISPs i some part of tehran. I changed my server and got another one and another domain valla! problem solved!

masoudelete commented 5 years ago

I have tried what you suggest but it didn't work

alexbers commented 5 years ago

I tried to fix the possible reason in https://github.com/alexbers/mtprotoproxy/commit/422c40948039adb71e8fc006b0925ed1bd394ba5.

Please try to use the latest proxy version from master branch.

Mahyar24 commented 5 years ago

Just don't use ports like 443, 8080 and etc!

masoudelete commented 5 years ago

@alexbers I've just tested the new master branch, the problem still exists.

I think some ISP's found a way to detect and block non-text MTProto packets

*UPDATE: I'm losing the ability to download and upload media in other ISP's (Hamrah aval) too. (text works fine)

alexbers commented 5 years ago

Are you using the proxy with advertising?

If not, please try to enable advertising (uncomment AD_TAG line in config.py). If yes, please try to disable it.

masoudelete commented 5 years ago

when commenting AD_TAG out: I couldn't download and upload images in all ISP's I could try

when using AD_TAG: I could Upload and download media in one ISP, I couldn't upload images in 2 other ISP's

alexbers commented 5 years ago

may be the problem with media servers access

could you try to change the line in the mtprotoproxy.py:

addr, port = random.choice(TG_MIDDLE_PROXIES_V4[dc_idx])

with

addr, port = random.choice(TG_MIDDLE_PROXIES_V4[abs(dc_idx)])

and repeat the test with AD_TAG enabled

masoudelete commented 5 years ago

I have tried what you suggested with and without AD_TAG, it didn't make any difference. consider that I have the same problem with the official telegram mtproto

GoldenOne1 commented 5 years ago

change your port dont use popular ports like 443

use random ports like 4731

masoudelete commented 5 years ago

I tried bunch of random ports, none of them made any difference. besides all of the good proxies I've seen used common ports like 443 and 80

GoldenOne1 commented 5 years ago

Im from iran and i use this without problem (Windows Server 2008)

Tested on Irancell , Hamrah Avval , Asiatech without any upload and download problem

masoudelete commented 5 years ago

@ea1234567 thank you for assisting me

I have a digitalocean server with ubuntu in Germany, can this problem be about my VPS provider or my OS?

what's your VPS and where is it located?

GoldenOne1 commented 5 years ago

My vps location is Hetzner Germany and everything is ok,Windows 2008 and Python 3.6.5

I had ovh france but that wasnt compatible with telegram mtproto and i had many disconnection

And i had problem with cloud vps too,dont buy cloud vps

HirbodBehnam commented 5 years ago

Hello I live in Iran too. I bought my server from virmach and in ParsOnline, Mobin Net, Irancell TD-LTE, and mobile operators are working fine and I can upload and download. My server datacenter is Eonix.

masoudelete commented 5 years ago

Does anybody else have a problem with DigitalOcean Droplets?

Can it be because I'm using cloud VPS?

m8603164 commented 5 years ago

Yes, dear friend, I have a similar problem. Unfortunately, DigitalOcean, Vultr and other American datacenters have this problem. It seems that in Iran bandwidth on the IP of these data centers is limited. Apparently, in the way of new blocking, IPs are on the blacklist, and after the blocking period, the bandwidth restrictions on them will continue to be active. As time passes, the IPs will suffer from bandwidth one after the other, and it seems unfortunately that MTProto will fail if no new update comes out.

GoldenOne1 commented 5 years ago

Hetzner Germany is best for mtproto (in iran)

m8603164 commented 5 years ago

Yes, I agree, but in the past. The number of Hetzner locations is very limited and most of its IPs are blocked in Iran, and some of them are blacklisted, so that they can not be used on the X telegram and desktop telegram.