add plugins
All checks were successful
Build Multi-Platform Binaries / build (push) Successful in 11m9s
All checks were successful
Build Multi-Platform Binaries / build (push) Successful in 11m9s
This commit is contained in:
@@ -10,6 +10,8 @@ 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/plugin/builtin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -49,6 +51,17 @@ func main() {
|
||||
log.Printf("[Server] TLS enabled")
|
||||
}
|
||||
|
||||
// 初始化插件系统
|
||||
registry := plugin.NewRegistry()
|
||||
if err := registry.RegisterBuiltin(builtin.NewSOCKS5Plugin()); err != nil {
|
||||
log.Printf("[Plugin] Register socks5 error: %v", err)
|
||||
}
|
||||
if err := registry.RegisterBuiltin(builtin.NewHTTPPlugin()); err != nil {
|
||||
log.Printf("[Plugin] Register http error: %v", err)
|
||||
}
|
||||
server.SetPluginRegistry(registry)
|
||||
log.Printf("[Plugin] Plugins registered: socks5, http")
|
||||
|
||||
// 启动 Web 控制台
|
||||
if cfg.Web.Enabled {
|
||||
ws := app.NewWebServer(clientStore, server, cfg, *configPath)
|
||||
|
||||
Reference in New Issue
Block a user