mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 11:56:53 +00:00
新功能+bug修复
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/cnlh/easyProxy/server"
|
||||
"github.com/cnlh/easyProxy/utils"
|
||||
_ "github.com/cnlh/easyProxy/web/routers"
|
||||
@@ -9,10 +10,9 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
configPath = flag.String("config", "config.json", "配置文件路径")
|
||||
TcpPort = flag.Int("tcpport", 8284, "客户端与服务端通信端口")
|
||||
TcpPort = flag.Int("tcpport", 0, "客户端与服务端通信端口")
|
||||
httpPort = flag.Int("httpport", 8024, "对外监听的端口")
|
||||
rpMode = flag.String("mode", "client", "启动模式")
|
||||
rpMode = flag.String("mode", "webServer", "启动模式")
|
||||
tunnelTarget = flag.String("target", "10.1.50.203:80", "远程目标")
|
||||
VerifyKey = flag.String("vkey", "", "验证密钥")
|
||||
u = flag.String("u", "", "验证用户名(socks5和web)")
|
||||
@@ -42,6 +42,15 @@ func main() {
|
||||
CompressEncode: 0,
|
||||
CompressDecode: 0,
|
||||
}
|
||||
if *TcpPort == 0 {
|
||||
p, err := beego.AppConfig.Int("tcpport")
|
||||
if err == nil && *rpMode == "webServer" {
|
||||
*TcpPort = p
|
||||
} else {
|
||||
*TcpPort = 8284
|
||||
}
|
||||
}
|
||||
log.SetFlags(log.Lshortfile)
|
||||
cnf.CompressDecode, cnf.CompressEncode = utils.GetCompressType(cnf.Compress)
|
||||
server.StartNewServer(*TcpPort, &cnf)
|
||||
}
|
||||
|
Reference in New Issue
Block a user