mtoxy icon indicating copy to clipboard operation
mtoxy copied to clipboard

sponsor channel

Open amin1softco opened this issue 6 years ago • 12 comments

how add sponsor channel in config ?

amin1softco avatar May 29 '18 09:05 amin1softco

I don't know, since apparently there is no official protocol specifications yet. If you know any open-source server that supports this feature — that will be great.

When Telegram team will release protocol specifications I'll add this feature to server.

makkarpov avatar May 29 '18 10:05 makkarpov

i see this proxy using port 8443 and have sponsor channel https://mtproto.tgproxy.cloud/mtproxy.html but tnx for your answer.

amin1softco avatar May 29 '18 10:05 amin1softco

By the "server" I meant server software, not host on the internet. Yeah, these ***.tgproxy.network:8443 support sponsored channels, but I have no information on how they do it.

makkarpov avatar May 29 '18 11:05 makkarpov

Same discussions almost in every mtproxy implementation. https://github.com/danog/MadelineProto/issues/429

https://github.com/alexbers/mtprotoproxy/issues/3

https://github.com/FreedomPrevails/JSMTProxy/issues/7

p1ratrulezzz avatar May 29 '18 21:05 p1ratrulezzz

I had done some experiments and found that promoted channels are not related to the actual IP address that you type in your client. E.g. set up mtoxy to forward all traffic to another proxy — you will still see original promoted channel even though your Telegram client thinks that you are connected to localhost.

So there is two possible ways to do such promotion:

  1. Proxy can inject packets before actual user data. These packets could tell Telegram servers which channel should be promoted.

  2. Telegram keeps a database of IP addresses of proxies and corresponding promoted channels. When Telegram servers see a connection from such IP address they show corresponding channel to user.

But anyway without official specs there is a no way to implement such functionality.

makkarpov avatar May 29 '18 21:05 makkarpov

you think so hard maybe simple as Secret is your sponsor channel id or username i tested this approach don't work...

amin1softco avatar May 30 '18 10:05 amin1softco

Secret key does not reach Telegram servers.

makkarpov avatar May 30 '18 12:05 makkarpov

Hey, check comment https://github.com/danog/MadelineProto/issues/429#issuecomment-393216530

They asking to add some "proxy tag". Have no idea what is it, looks like

Success! Your proxy has been successfully registered. You can now pass this proxy tag to the software you are using: 0c5cc91bd9a47ca8d0e70b254cb3c7ab.

And voila official mtproxy https://github.com/TelegramMessenger/MTProxy

p1ratrulezzz avatar May 30 '18 16:05 p1ratrulezzz

After running proxy on your server, you must register your server in MTProxy Admin Bot (@mtproxybot) and get your proxy tag. It is an official bot from telegram and you can set promotion channel in this bot.

mnameghi avatar May 31 '18 01:05 mnameghi

@mnameghi i have register my server in @mtproxybot. and i have my proxy tag now and promoted a channel. so what is this tag? and how can i show channel to users?

ehaidari avatar May 31 '18 04:05 ehaidari

@ehaidari wait until proxy tag support is added to this server software. For now promoted channels are possible to setup only with official proxy soft

p1ratrulezzz avatar May 31 '18 04:05 p1ratrulezzz

https://github.com/alexbers/mtprotoproxy/commit/fee5a0c05ae855d97e12a46253e4ad50395df17c advertising was added here. Possibly will be better to read the code for reimplementation from Python

p1ratrulezzz avatar Jun 03 '18 22:06 p1ratrulezzz