移除反向代理代码

This commit is contained in:
lwch
2021-11-18 23:17:44 +08:00
parent 4ce221eeae
commit d30b27367f
59 changed files with 93 additions and 439 deletions

View File

@@ -4,10 +4,9 @@ import (
"natpass/code/client/dashboard"
"natpass/code/client/global"
"natpass/code/client/pool"
"natpass/code/client/tunnel"
"natpass/code/client/tunnel/reverse"
"natpass/code/client/tunnel/shell"
"natpass/code/client/tunnel/vnc"
tunnel "natpass/code/client/rule"
"natpass/code/client/rule/shell"
"natpass/code/client/rule/vnc"
"natpass/code/network"
rt "runtime"
"time"
@@ -55,12 +54,8 @@ func (a *App) run() {
pl := pool.New(a.cfg)
mgr := tunnel.New()
for _, t := range a.cfg.Tunnels {
for _, t := range a.cfg.Rules {
switch t.Type {
case "tcp", "udp":
tn := reverse.New(t)
mgr.Add(tn)
go tn.Handle(pl)
case "shell":
sh := shell.New(t)
mgr.Add(sh)
@@ -89,8 +84,6 @@ func (a *App) run() {
switch msg.GetXType() {
case network.Msg_connect_req:
switch msg.GetCreq().GetXType() {
case network.ConnectRequest_tcp, network.ConnectRequest_udp:
a.connect(mgr, conn, msg)
case network.ConnectRequest_shell:
a.shellCreate(mgr, conn, msg)
case network.ConnectRequest_vnc: