feat: remove unused plugin version comparison and types, refactor proxy server to support authentication
- Deleted version comparison logic from `pkg/plugin/sign/version.go`. - Removed unused types and constants from `pkg/plugin/types.go`. - Updated `pkg/protocol/message.go` to remove plugin-related message types. - Enhanced `pkg/proxy/http.go` and `pkg/proxy/socks5.go` to include username/password authentication for HTTP and SOCKS5 proxies. - Modified `pkg/proxy/server.go` to pass authentication parameters to server constructors. - Added new API endpoint to generate installation commands with a token for clients. - Created database functions to manage installation tokens in `internal/server/db/install_token.go`. - Implemented the installation command generation logic in `internal/server/router/handler/install.go`. - Updated web frontend to support installation command generation and display in `web/src/views/ClientsView.vue`.
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"github.com/gotunnel/internal/client/config"
|
||||
"github.com/gotunnel/internal/client/tunnel"
|
||||
"github.com/gotunnel/pkg/crypto"
|
||||
"github.com/gotunnel/pkg/plugin"
|
||||
"github.com/gotunnel/pkg/version"
|
||||
)
|
||||
|
||||
@@ -68,14 +67,5 @@ func main() {
|
||||
log.Printf("[Client] TLS enabled")
|
||||
}
|
||||
|
||||
// 初始化插件注册表(用于 JS 插件)
|
||||
registry := plugin.NewRegistry()
|
||||
client.SetPluginRegistry(registry)
|
||||
|
||||
// 初始化版本存储
|
||||
if err := client.InitVersionStore(); err != nil {
|
||||
log.Printf("[Client] Warning: failed to init version store: %v", err)
|
||||
}
|
||||
|
||||
client.Run()
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import (
|
||||
"github.com/gotunnel/internal/server/db"
|
||||
"github.com/gotunnel/internal/server/tunnel"
|
||||
"github.com/gotunnel/pkg/crypto"
|
||||
"github.com/gotunnel/pkg/plugin"
|
||||
"github.com/gotunnel/pkg/version"
|
||||
)
|
||||
|
||||
@@ -80,11 +79,8 @@ func main() {
|
||||
log.Printf("[Server] TLS enabled")
|
||||
}
|
||||
|
||||
// 初始化插件系统(用于客户端 JS 插件管理)
|
||||
registry := plugin.NewRegistry()
|
||||
server.SetPluginRegistry(registry)
|
||||
server.SetJSPluginStore(clientStore) // 设置 JS 插件存储,用于客户端重连时恢复插件
|
||||
server.SetTrafficStore(clientStore) // 设置流量存储,用于记录流量统计
|
||||
// 设置流量存储,用于记录流量统计
|
||||
server.SetTrafficStore(clientStore)
|
||||
|
||||
// 启动 Web 控制台
|
||||
if cfg.Server.Web.Enabled {
|
||||
|
||||
Reference in New Issue
Block a user