重命名客户端相关术语为节点;移动 utils 包到根路径;优化网关对节点各种连接状态的处理,并在节点断联后统一清理资源

This commit is contained in:
2025-05-17 10:00:28 +08:00
parent 20ac7dbd91
commit 84e01d3b50
14 changed files with 150 additions and 129 deletions

View File

@@ -12,7 +12,7 @@ import (
"net"
"proxy-server/gateway/core"
"proxy-server/gateway/fwd/auth"
"proxy-server/pkg/utils"
"proxy-server/utils"
"slices"
)
@@ -90,7 +90,7 @@ func Process(ctx context.Context, conn net.Conn) (*core.Conn, error) {
}, nil
}
// checkVersion 检查客户端版本
// checkVersion 检查节点版本
func checkVersion(reader io.Reader) error {
version, err := utils.ReadByte(reader)
if err != nil {
@@ -98,7 +98,7 @@ func checkVersion(reader io.Reader) error {
}
if version != Version {
return errors.New("客户端版本不兼容")
return errors.New("节点版本不兼容")
}
return nil
@@ -113,7 +113,7 @@ func authenticate(ctx context.Context, reader *bufio.Reader, conn net.Conn) (aut
return nil, err
}
// 获取客户端认证方式
// 获取节点认证方式
nAuth, err := utils.ReadByte(reader)
if err != nil {
return nil, err