守护进程 负载均衡

This commit is contained in:
刘河
2019-02-03 00:54:43 +08:00
parent 662a799f02
commit da899fd3db
20 changed files with 341 additions and 129 deletions

View File

@@ -3,20 +3,30 @@ package main
import (
"flag"
"github.com/cnlh/easyProxy/client"
"log"
"github.com/cnlh/easyProxy/utils"
_ "github.com/cnlh/easyProxy/utils"
"strings"
)
const VERSION = "v0.0.13"
var (
serverAddr = flag.String("server", "", "服务器地址ip:端口")
verifyKey = flag.String("vkey", "", "验证密钥")
logType = flag.String("log", "stdout", "日志输出方式stdout|file")
)
func main() {
flag.Parse()
utils.InitDaemon("client")
if *logType == "stdout" {
utils.InitLogFile("client", true)
} else {
utils.InitLogFile("client", false)
}
stop := make(chan int)
for _, v := range strings.Split(*verifyKey, ",") {
log.Println("客户端启动,连接:", *serverAddr, " 验证令牌:", v)
utils.Println("客户端启动,连接:", *serverAddr, " 验证令牌:", v)
go client.NewRPClient(*serverAddr, v).Start()
}
<-stop