main.go 397 B

123456789101112131415161718192021222324
  1. package main
  2. import (
  3. "flag"
  4. "fmt"
  5. "github.com/zu1k/proxypool/api"
  6. "github.com/zu1k/proxypool/app"
  7. )
  8. func main() {
  9. filePath := flag.String("c", "", "path to config file: source.yaml")
  10. flag.Parse()
  11. if *filePath == "" {
  12. app.NeedFetchNewConfigFile = true
  13. } else {
  14. app.InitConfigAndGetters(*filePath)
  15. }
  16. go app.Cron()
  17. fmt.Println("Do the first crawl...")
  18. app.CrawlGo()
  19. api.Run()
  20. }