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
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

run.go 436B

1234567891011121314151617181920
  1. package cli
  2. import (
  3. "fmt"
  4. "github.com/9seconds/mtg/v2/internal/utils"
  5. )
  6. type Run struct {
  7. ConfigPath string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"` // nolint: lll
  8. }
  9. func (r *Run) Run(cli *CLI, version string) error {
  10. conf, err := utils.ReadConfig(r.ConfigPath)
  11. if err != nil {
  12. return fmt.Errorf("cannot init config: %w", err)
  13. }
  14. return runProxy(conf, version)
  15. }