MTProxy

Async Python MTProto Proxy


Keywords
mtproto, proxy, async, asynchronous
License
MIT
Install
pip install MTProxy==0.1.3

Documentation

MTProxy

A fully OOP Asynchronous Python 3 MT-Proto proxy

Features

  • Easy to use: you can easily use it
  • Lightweight less resources as possible but not by losing maintainability.
  • Fully-asynchronous: it runs asynchronously
  • High-performance: processes a lot of connections
  • Block-Mode Protection from replay attacks used to detect proxies in some countries

Installation

To install last stable release from pypi:

$ pip3 install mtproxy

or with uvloop as extra requirement (recommended):

$ pip3 install mtproxy[fast]

uvloop makes asyncio fast.

Usage

To launch with custom config

# config.ini

#proxy settings
[mtproxy]

# port = 8585
## The Port that Proxy listening to. 8585 by default

# fast_mode = ture
# true by deaultif True, disables telegram to client traffic re-encryption, faster but less secure.

# prefer_ipv6 = ture
# if IPv6 available, use it by default.

# secure_only = false
# Don't allow to connect in not-secure mode. false by default

# listen_addr_ipv4 = 0.0.0.0
# Listen address for IPv4. '0.0.0.0' by default

# listen_addr_ipv6 = ::
# Listen address for IPv6 by default

# client_handshake_timeout = 10
# Drop client after this timeout if the handshake fail, 10 by default

# client_keepalive = 600
# Keep alive period for clients in secs, 600 by default.

# client_ack_timeout = 300
# if client doesn't confirm data for this number of seconds, it is dropped, 300 by default.

# server_connect_timeout = 10
# Telegram servers connect timeout in seconds, 10 by default/.

# to_client_buffer_size = 131072
# Max socket buffer size to the client direction, the more the faster, but more RAM hungry, 131072 by default.

# to_server_buffer_size = 65536
# Max socket buffer size to the telegram servers direction, 65536 by default.

# block_mode = true
# Drop client if first packet is bad, true by default.

# reply_check_length = 
# Length of used handshake randoms for active fingerprinting protection, 32768 by default.

# ipv4 = 
# IPv4 address to show data, if Ignored, will be Obtained.

# ipv6 = 
# IPv6 address to show data, if Ignored, will be Obtained.


# proxy users section.
[mtproxy:users]
# name_of_user = proxy_secret_key
HemMm = 7e7ee7be6b40378e593c36433294b03c

launch proxy:

mtproxy config.ini

# mtproxy CONFIG_FILE_NAME

Special Thanks to alexbers for his great project

License

MIT