Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
9seconds 9f90f87758 Add RPC structs for nonce 7 gadus atpakaļ
client Propagate connection protocol 7 gadus atpakaļ
config Tune socket options 7 gadus atpakaļ
mtproto Add RPC structs for nonce 7 gadus atpakaļ
obfuscated2 Support different client connection types 7 gadus atpakaļ
proxy Tune socket options 7 gadus atpakaļ
scripts Add Makefile 8 gadus atpakaļ
telegram Propagate connection protocol 7 gadus atpakaļ
wrappers Tune socket options 7 gadus atpakaļ
.gitignore Add boilerplate 8 gadus atpakaļ
.gometalinter.json Fix lint issues 8 gadus atpakaļ
.travis.yml Add travis yaml 8 gadus atpakaļ
Dockerfile Use upx for image build 7 gadus atpakaļ
Gopkg.lock Use pool for frames 7 gadus atpakaļ
Gopkg.toml Working version 8 gadus atpakaļ
LICENSE Initial commit 8 gadus atpakaļ
Makefile Fix dockerfile 7 gadus atpakaļ
README.md Fix readme for secret generation 7 gadus atpakaļ
main.go Propagate connection protocol 7 gadus atpakaļ
run-mtg.sh Fix run-mtg 7 gadus atpakaļ

README.md

mtg

Bullshit-free MTPROTO proxy for Telegram

Build Status Docker Build Status

Rationale

There are several available proxies for Telegram MTPROTO available. Here are the most notable:

Almost all of them follow the way how official proxy was build. This includes support of multiple secrets, support of promoted channels etc.

mtg is an implementation in golang which is intended to be:

  • Lightweight It has to consume as less resources as possible but not by losing maintainability.
  • Easily deployable I strongly believe that Telegram proxies should follow the way of ShadowSocks: promoted channels is a strange way of doing business I suppose. I think the only viable way is to have a proxy with minimum configuration which should work everywhere.
  • Single secret I think that multiple secrets solves no problems and just complexify software. I also believe that in case of throwout proxies, this feature is useless luxury.
  • Minimum docker image size Official image is less than 2 megabytes. Literally.
  • No management WebUI This is an implementation of simple lightweight proxy. I won’t do that.

How to build

$ make

If you want to build for another platform:

$ make crosscompile

If you want to build Docker image (called mtg):

$ make docker

Docker image

$ docker pull nineseconds/mtg

Configuration

Basically, to run this tool you need to configure as less as possible.

First, you need to generate a secret:

$ openssl rand -hex 16

or

$ head -c 512 /dev/urandom | md5sum | cut -f 1 -d ' '

Now run the tool:

$ mtg <secret>

This tool will listen on port 3128 by default with the given secret.

One-line runner

$ docker run --name mtg --restart=unless-stopped -p 3128:3128 -p 3129:3129 -d nineseconds/mtg $(openssl rand -hex 16)

You will have this tool up and running on port 3128. Now curl localhost:3129 to get tg:// links or do docker logs mtg. Also, port 3129 will show you some statistics if you are interested in.

Also, you can use run-mtg.sh script