mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-04 00:05:21 -05:00
refine app settings in v2ray config
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"v2ray.com/core/app"
|
||||
"v2ray.com/core/app/dns"
|
||||
"v2ray.com/core/common/loader"
|
||||
"v2ray.com/core/common/log"
|
||||
v2net "v2ray.com/core/common/net"
|
||||
)
|
||||
@@ -107,3 +108,18 @@ func (this *Router) TakeDetour(dest v2net.Destination) (string, error) {
|
||||
}
|
||||
return tag, err
|
||||
}
|
||||
|
||||
type RouterFactory struct{}
|
||||
|
||||
func (RouterFactory) Create(space app.Space, config interface{}) (app.Application, error) {
|
||||
router := NewRouter(config.(*Config), space)
|
||||
return router, nil
|
||||
}
|
||||
|
||||
func (RouterFactory) AppId() app.ID {
|
||||
return APP_ID
|
||||
}
|
||||
|
||||
func init() {
|
||||
app.RegisterApplicationFactory(loader.GetType(new(Config)), RouterFactory{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user