Skip to content

Instantly share code, notes, and snippets.

@cedws
Created March 2, 2022 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedws/12d469d1f4fa924392a70821090b0b70 to your computer and use it in GitHub Desktop.
Save cedws/12d469d1f4fa924392a70821090b0b70 to your computer and use it in GitHub Desktop.

MTProto Proxy Setup

This guide uses mtg because it looks like the most easy and foolproof option.

  • Create a VM/VPS

  • (Optional) Create a DNS A record

  • Install Docker CE

  • Generate a shared secret

    $ docker run --rm nineseconds/mtg:2 generate-secret <DOMAIN>
    7p9VGZu2jopBL2SCfSNAdeZtdGcuY2Vkd2FyZHMueHl6
    
  • Create mtg.toml which looks like the following:

    secret = "<SECRET>"
    bind-to = "0.0.0.0:3128"
  • (Optional) Generate access links

    • docker run --rm -v $PWD/mtg.toml:/config.toml nineseconds/mtg:2 access /config.toml
  • Start the server

    • docker run --rm --name mtg -p 3128:3128 -v $PWD/mtg.toml:/config.toml -d nineseconds/mtg:2 run /config.toml
  • Open Telegram and enter the proxy settings under Settings > Data and Storage > Proxy Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment