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
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

main.go 821B

1234567891011121314151617181920212223242526272829303132333435
  1. // mtg is just a command-line application that starts a proxy.
  2. //
  3. // Application logic is how to read a config and configure mtglib.Proxy.
  4. // So, probably you need to read the documentation for mtglib package
  5. // first.
  6. //
  7. // mtglib is a core of the application. The rest of the packages provide
  8. // some default implementations for the interfaces, defined in mtglib.
  9. package main
  10. import (
  11. "math/rand"
  12. "time"
  13. "github.com/9seconds/mtg/v2/internal/cli"
  14. "github.com/9seconds/mtg/v2/internal/utils"
  15. "github.com/alecthomas/kong"
  16. )
  17. var version = "dev" // has to be set by ldflags
  18. func main() {
  19. rand.Seed(time.Now().UTC().UnixNano())
  20. if err := utils.SetLimits(); err != nil {
  21. panic(err)
  22. }
  23. cli := &cli.CLI{}
  24. ctx := kong.Parse(cli, kong.Vars{
  25. "version": version,
  26. })
  27. ctx.FatalIfErrorf(ctx.Run(cli, version))
  28. }