mtproto_proxy icon indicating copy to clipboard operation
mtproto_proxy copied to clipboard

Limit on bandwidth per user/connection/secret

Open arpanetus opened this issue 4 years ago • 1 comments

Is there any way to configure it in a such way that I could limit on bandwidth per secret, connection or ~user?

Thanks.

arpanetus avatar Jan 10 '22 11:01 arpanetus

Hi. There is no such functionality currently. It might be easy to implement for "inbound" traffic (eg, users uploading image/video), but not that easy to do for "outbound" traffic (users downloading images/videos etc) because of multiplexing. Because with multiplexing many "telegram app -> mtproxy" connections are multiplexed to a single "proxy -> telegram server" connection and there is no way for proxy to do a TCP backpressure for a single specific client. We can try to implement, but there is a risk proxy would use much more RAM then (because Telegram server will be sending data to proxy very fast, while proxy will be sending this data to client with limited speed, so, need to cache the data in memory).

It should be much more easy to implement in Python proxy, because it does not support multiplexing.

seriyps avatar Jan 10 '22 17:01 seriyps