Skip to content

Commit

Permalink
Added microbadger
Browse files Browse the repository at this point in the history
  • Loading branch information
homdx committed Aug 3, 2018
1 parent 0c83644 commit f8d5133
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

The Telegram Messenger MTProto proxy is a zero-configuration container that automatically sets up a proxy server that speaks Telegram's native MTProto.

[![](https://images.microbadger.com/badges/image/homdx/mtproxy.svg)](https://microbadger.com/images/homdx/mtproxy "Get your own image badge on microbadger.com")

[![](https://images.microbadger.com/badges/version/homdx/mtproxy.svg)](https://microbadger.com/images/homdx/mtproxy "Get your own version badge on microbadger.com")

## Quick reference
To start the proxy all you need to do is
`docker run -d -p443:443 --name=mtproxy --restart=always -v ./config:/data alexdoesh/mtproxy:latest`
`docker run -d -p443:443 --name=mtproxy --restart=always -v ./config:/data homdx/mtproxy:latest`

The container's log output (`docker logs mtproxy`) will contain the links to paste into the Telegram app:

Expand All @@ -28,19 +32,19 @@ Once your MTProxy server is up and running go to [@MTProxybot](https://t.me/mtpr

## Custom configuration
If you need to specify a custom secret (say, if you are deploying multiple proxies with DNS load-balancing), you may pass the SECRET environment variable as 16 bytes in lower-case hexidecimals.:
`docker run -d -p443:443 -v ./config:/data -e SECRET=00baadf00d15abad1deaa51sbaadcafe alexdoesh/mtproxy:latest`
`docker run -d -p443:443 -v ./config:/data -e SECRET=00baadf00d15abad1deaa51sbaadcafe homdx/mtproxy:latest`

The proxy may be configured to accept up to 16 different secrets. You may specify them explicitly as comma-separated hex strings in the SECRET environment variable, or you may let the container generate the secrets automatically using the SECRET_COUNT variable to limit the number of generated secrets.

`docker run -d -p443:443 -v ./config:/data -e SECRET=935ddceb2f6bbbb78363b224099f75c8,2084c7e58d8213296a3206da70356c81 telegrammessenger/proxy:latest`
`docker run -d -p443:443 -v ./config:/data -e SECRET_COUNT=4 alexdoesh/mtproxy:latest`
`docker run -d -p443:443 -v ./config:/data -e SECRET_COUNT=4 homdx/mtproxy:latest`

A custom advertisement tag may be provided using the TAG environment variable:
`docker run -d -p443:443 -v ./config:/data -e TAG=3f40462915a3e6026a4d790127b95ded alexdoesh/mtproxy:latest`.
`docker run -d -p443:443 -v ./config:/data -e TAG=3f40462915a3e6026a4d790127b95ded homdx/mtproxy:latest`.
Please note that the tag is not persistent: you'll have to provide it as an environment variable every time you run an MTProto proxy container.

A single worker process is expected to handle tens of thousands of clients on a modern CPU. For best performance we artificially limit the proxy to 60000 connections per core and run two workers by default. If you have many clients, be sure to adjust the WORKERS variable:
`docker run -d -p443:443 -v ./config:/data -e WORKERS=16 alexdoesh/mtproxy:latest`
`docker run -d -p443:443 -v ./config:/data -e WORKERS=16 homdx/mtproxy:latest`

## Monitoring
The MTProto proxy server exports internal statistics as tab-separated values over the http://localhost:2398/stats endpoint. Please note that this endpoint is available only from localhost: depending on your configuration, you may need to collect the statistics with `docker exec mtproto-proxy curl http://localhost:2398/stats`.
Expand Down

0 comments on commit f8d5133

Please sign in to comment.