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
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

root_context_windows.go 316B

1234567891011121314151617181920212223
  1. // +build windows
  2. package utils
  3. import (
  4. "context"
  5. "os"
  6. "os/signal"
  7. )
  8. func RootContext() context.Context {
  9. ctx, cancel := context.WithCancel(context.Background())
  10. sigChan := make(chan os.Signal, 1)
  11. signal.Notify(sigChan, os.Interrupt)
  12. go func() {
  13. for range sigChan {
  14. cancel()
  15. }
  16. }()
  17. return ctx
  18. }