main.go 455 B

123456789101112131415161718192021222324252627282930
  1. package main
  2. import (
  3. "os"
  4. "sync"
  5. "github.com/fatedier/frp/pkg/utils/log"
  6. )
  7. func main() {
  8. err := LoadConf("./frpc.ini")
  9. if err != nil {
  10. os.Exit(-1)
  11. }
  12. log.InitLog(LogWay, LogFile, LogLevel)
  13. // wait until all control goroutine exit
  14. var wait sync.WaitGroup
  15. wait.Add(len(ProxyClients))
  16. for _, client := range ProxyClients {
  17. go ControlProcess(client, &wait)
  18. }
  19. log.Info("Start frpc success")
  20. wait.Wait()
  21. log.Warn("All proxy exit!")
  22. }