-
Notifications
You must be signed in to change notification settings - Fork 44
/
main.go
36 lines (29 loc) · 741 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"flag"
"fmt"
"log"
"path/filepath"
"github.com/fsgo/fsconf/confext"
"github.com/hidu/proxy-manager/internal"
)
var configPath = flag.String("conf", "./conf/proxy.toml", "proxy's config file")
var initConf = flag.Bool("init", false, "create config files if not exists")
func init() {
flag.Usage = func() {
fmt.Println("proxy manager\n version:", internal.GetVersion())
fmt.Print(" https://github.com/hidu/proxy-manager/\n\n")
flag.PrintDefaults()
}
log.SetFlags(log.Lshortfile | log.LstdFlags | log.Ldate)
confext.Init()
}
func main() {
flag.Parse()
if *initConf {
internal.InitConf(filepath.Dir(*configPath))
return
}
manager := internal.NewProxyManager(*configPath)
manager.Start()
}