1
0
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:
Darien Raymond
2016-10-16 16:04:30 +02:00
parent e33b7df34c
commit e866ff24a4
6 changed files with 129 additions and 91 deletions

View File

@@ -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{})
}