seriyps / mtproto_proxy

High performance Erlang MTProto proxy that powers https://t.me/socksy_bot
https://t.me/erlang_mtproxy
Apache License 2.0
551 stars 99 forks source link

ipv6 support? #11

Open SmOkEnksp opened 5 years ago

seriyps commented 5 years ago

Do you need it on client-to-proxy or proxy-to-telegram side?

ср, 3 апр. 2019 г., 18:48 SmOkEnksp notifications@github.com:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/seriyps/mtproto_proxy/issues/11, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZwfkbX0zpqEMxQ0xp30KvplHlvZ1Pnks5vdNtFgaJpZM4ca-XQ .

SmOkEnksp commented 5 years ago

idk telegram use ipv6 or not, so maybe for first on client-to-proxy

SmOkEnksp commented 5 years ago

i think both would be nice

seriyps commented 5 years ago

But do you have any reason to want to have it? As far as I know, ipv6 is not supported in Iran and works not very well in Russia. Do you have any particular usecase for it?

SmOkEnksp commented 5 years ago

Do you have any particular usecase for it? i have two servers where installed ipv6, and i know DPI bad working on ipv6. anyway in 2019 support ipv6 is good.

seriyps commented 5 years ago

I will try to add this soon. Sorry for the late response!

seriyps commented 5 years ago

Well, I implemented IPv6 for client connections (Telegram client-to-proxy), see https://github.com/seriyps/mtproto_proxy#ipv6 . Not sure if will add proxy-to-telegram-server in a foreseen future.

danyhm commented 5 years ago

But do you have any reason to want to have it? As far as I know, ipv6 is not supported in Iran and works not very well in Russia. Do you have any particular usecase for it?

hello @seriyps thank you very much for your hard work. I was using the alex python version but I heard yours is better so I switched today.

the main reason was that I saw you support IPv6 but after installing and following the instruction I could not get it to work. I'm pretty sure I had setup ipv6 correctly because I tested another mtproto proxy called mtoxy and it worked perfectly. bad thing is that it did not support fake tls.

IPv6 is partially supported in Iran (I know Irancell and Rightel operators both support it. don't know about others).

the great thing about IPv6 is that nowadays most VPS providers provide huge blocks of Ipv6 so if one gets blocked we can easily add another without paying anything. (my VPS provider has given me /64 netmask which is enough for the whole middle east even if they block 1 IP per day per person.)

So I would say adding good IPv6 support is very essential.

seriyps commented 5 years ago

@danyhm ipv6 is supported now, but only for connections from clients to proxy. Not proxy to telegram server. See https://github.com/seriyps/mtproto_proxy#ipv6.

So, if you will set it up as it says in docs, your proxy server will connect to telegram servers by ipv4, but your clients will be able to connect by both ipv6 and ipv4.

danyhm commented 5 years ago

@seriyps I did as the https://github.com/seriyps/mtproto_proxy#ipv6 said but could not connect from ipv6 address. how can I troubleshoot this?

seriyps commented 5 years ago

@danyhm can you do /opt/mtp_proxy/bin/mtp_proxy eval 'ranch:info().'? Also, it might be easier to discuss in Telegram: https://t.me/erlang_mtproxy

danyhm commented 5 years ago

@seriyps yes I can, I joined the group will discuss it there