|
|
@ -27,6 +27,7 @@ import ( |
|
|
|
"math/big" |
|
|
|
"math/big" |
|
|
|
"net" |
|
|
|
"net" |
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
|
|
|
|
|
"sort" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/fatedier/frp/assets" |
|
|
|
"github.com/fatedier/frp/assets" |
|
|
@ -133,8 +134,14 @@ func NewService(cfg config.ServerCommonConf) (svr *Service, err error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Init all plugins
|
|
|
|
// Init all plugins
|
|
|
|
for name, options := range cfg.HTTPPlugins { |
|
|
|
plugin_names := make([]string, 0, len(cfg.HTTPPlugins)) |
|
|
|
svr.pluginManager.Register(plugin.NewHTTPPluginOptions(options)) |
|
|
|
for n := range cfg.HTTPPlugins { |
|
|
|
|
|
|
|
plugin_names = append(plugin_names, n) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
sort.Strings(plugin_names) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for _, name := range plugin_names { |
|
|
|
|
|
|
|
svr.pluginManager.Register(plugin.NewHTTPPluginOptions(cfg.HTTPPlugins[name])) |
|
|
|
log.Info("plugin [%s] has been registered", name) |
|
|
|
log.Info("plugin [%s] has been registered", name) |
|
|
|
} |
|
|
|
} |
|
|
|
svr.rc.PluginManager = svr.pluginManager |
|
|
|
svr.rc.PluginManager = svr.pluginManager |
|
|
|