重构代理解析流程,引入端口混合协议转发

This commit is contained in:
2025-03-01 17:08:56 +08:00
parent b8a3dd93dc
commit 76139d28c4
24 changed files with 841 additions and 1042 deletions

20
server/models/channel.go Normal file
View File

@@ -0,0 +1,20 @@
package models
import (
"time"
"gorm.io/gorm"
)
// Channel 连接认证模型
type Channel struct {
gorm.Model
UserId uint
NodeId uint
Protocol string
Username string
Password string
AuthIp bool
AuthPass bool
Expiration time.Time
}

14
server/models/node.go Normal file
View File

@@ -0,0 +1,14 @@
package models
import "gorm.io/gorm"
// Node 客户端模型
type Node struct {
gorm.Model
Name string
Provider string
Location string
IPAddress string
Channels []Channel `gorm:"foreignKey:NodeId"`
}

9
server/models/user-ip.go Normal file
View File

@@ -0,0 +1,9 @@
package models
import "gorm.io/gorm"
type UserIp struct {
gorm.Model
UserId uint
IpAddress string
}

14
server/models/user.go Normal file
View File

@@ -0,0 +1,14 @@
package models
import "gorm.io/gorm"
type User struct {
gorm.Model
Password string
Username string
Email string
Phone string
Name string
Channels []Channel `gorm:"foreignKey:UserId"`
}