守护进程 负载均衡

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

@@ -5,7 +5,6 @@ import (
"github.com/astaxie/beego"
"github.com/cnlh/easyProxy/bridge"
"github.com/cnlh/easyProxy/utils"
"log"
"net"
"strings"
)
@@ -39,7 +38,7 @@ func (s *TunnelModeServer) Start() error {
if strings.Contains(err.Error(), "use of closed network connection") {
break
}
log.Println(err)
utils.Println(err)
continue
}
go s.process(utils.NewConn(conn), s)
@@ -71,12 +70,13 @@ type WebServer struct {
}
//开始
func (s *WebServer) Start() {
func (s *WebServer) Start() error {
beego.BConfig.WebConfig.Session.SessionOn = true
log.Println("web管理启动访问端口为", beego.AppConfig.String("httpport"))
utils.Println("web管理启动访问端口为", beego.AppConfig.String("httpport"))
beego.SetViewsPath(beego.AppPath + "/web/views")
beego.SetStaticPath("/static", beego.AppPath+"/web/static")
beego.Run()
return errors.New("web管理启动失败")
}
//new