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
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

cli_generate_secret.go 636B

123456789101112131415161718192021222324
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/9seconds/mtg/v2/mtglib"
  5. )
  6. type cliCommandGenerateSecret struct {
  7. HostName string `arg optional help:"Hostname to use for domain fronting. Default is '${domain_front}'." name:"hostname" default:"${domain_front}"` // nolint: lll, govet
  8. Hex bool `help:"Print secret in hex encoding."`
  9. }
  10. func (c *cliCommandGenerateSecret) Run(cli *CLI) error { // nolint: unparam
  11. secret := mtglib.GenerateSecret(cli.GenerateSecret.HostName)
  12. if cli.GenerateSecret.Hex {
  13. fmt.Println(secret.Hex()) // nolint: forbidigo
  14. } else {
  15. fmt.Println(secret.Base64()) // nolint: forbidigo
  16. }
  17. return nil
  18. }