mirror of https://github.com/qwqdanchun/nps.git
命令行模式同步
This commit is contained in:
parent
4e6754deb9
commit
c336bf94d8
|
@ -71,7 +71,6 @@ func (s *TRPClient) processor(c *utils.Conn) {
|
|||
if link, err := c.GetLinkInfo(); err != nil {
|
||||
break
|
||||
} else {
|
||||
log.Println(link)
|
||||
s.Lock()
|
||||
s.linkMap[link.Id] = link
|
||||
s.Unlock()
|
||||
|
@ -118,10 +117,10 @@ func (s *TRPClient) linkProcess(link *utils.Link, c *utils.Conn) {
|
|||
break
|
||||
}
|
||||
utils.PutBufPoolCopy(buf)
|
||||
if link.ConnType == utils.CONN_UDP {
|
||||
c.Close()
|
||||
break
|
||||
}
|
||||
//if link.ConnType == utils.CONN_UDP {
|
||||
// c.Close()
|
||||
// break
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ var (
|
|||
)
|
||||
|
||||
func main() {
|
||||
log.SetFlags(log.Lshortfile)
|
||||
flag.Parse()
|
||||
stop := make(chan int)
|
||||
for _, v := range strings.Split(*verifyKey, ",") {
|
||||
|
|
|
@ -22,7 +22,6 @@ var (
|
|||
)
|
||||
|
||||
func main() {
|
||||
log.SetFlags(log.Lshortfile)
|
||||
flag.Parse()
|
||||
task := &utils.Tunnel{
|
||||
TcpPort: *httpPort,
|
||||
|
@ -45,6 +44,8 @@ func main() {
|
|||
Remark: "",
|
||||
Status: true,
|
||||
IsConnect: false,
|
||||
Cnf: &utils.Config{},
|
||||
Flow: &utils.Flow{},
|
||||
}
|
||||
c.Cnf.CompressDecode, c.Cnf.CompressEncode = utils.GetCompressType(c.Cnf.Compress)
|
||||
server.CsvDb.Clients[0] = c
|
||||
|
@ -60,5 +61,8 @@ func main() {
|
|||
}
|
||||
log.Println("服务端启动,监听tcp服务端端口:", *TcpPort)
|
||||
task.Config.CompressDecode, task.Config.CompressEncode = utils.GetCompressType(task.Config.Compress)
|
||||
if *rpMode!="webServer" {
|
||||
server.CsvDb.Tasks[0] = task
|
||||
}
|
||||
server.StartNewServer(*TcpPort, task)
|
||||
}
|
||||
|
|
|
@ -143,7 +143,6 @@ func (s *Sock5ModeServer) doConnect(c net.Conn, command uint8) {
|
|||
link := utils.NewLink(s.task.Client.GetId(), ltype, addr, s.config.CompressEncode, s.config.CompressDecode, s.config.Crypt, utils.NewConn(c), s.task.Flow, nil, s.task.Client.Rate, nil)
|
||||
|
||||
if tunnel, err := s.bridge.SendLinkInfo(s.task.Client.Id, link); err != nil {
|
||||
log.Println("error", err, link)
|
||||
c.Close()
|
||||
return
|
||||
} else {
|
||||
|
|
|
@ -127,7 +127,6 @@ func ProcessHttp(c *utils.Conn, s *TunnelModeServer) error {
|
|||
}
|
||||
method, addr, rb, err, r := c.GetHost()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
c.Close()
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue