clash/main.go

31 lines
533 B
Go
Raw Normal View History

2018-06-10 14:50:03 +00:00
package main
import (
"os"
"os/signal"
"syscall"
"github.com/Dreamacro/clash/config"
2018-06-18 03:31:49 +00:00
"github.com/Dreamacro/clash/hub"
2018-07-15 14:23:20 +00:00
"github.com/Dreamacro/clash/proxy"
2018-06-10 14:50:03 +00:00
"github.com/Dreamacro/clash/tunnel"
log "github.com/sirupsen/logrus"
)
func main() {
tunnel.Instance().Run()
proxy.Instance().Run()
hub.Run()
2018-06-10 14:50:03 +00:00
config.Init()
err := config.Instance().Parse()
2018-06-10 14:50:03 +00:00
if err != nil {
log.Fatalf("Parse config error: %s", err.Error())
2018-06-18 03:31:49 +00:00
}
2018-06-10 14:50:03 +00:00
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
<-sigCh
}