1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-12 08:45:25 -04: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

@@ -7,6 +7,7 @@ import (
"v2ray.com/core/app"
"v2ray.com/core/app/dispatcher"
"v2ray.com/core/common/loader"
"v2ray.com/core/common/log"
v2net "v2ray.com/core/common/net"
@@ -111,3 +112,18 @@ func (this *CacheServer) Get(domain string) []net.IP {
log.Debug("DNS: Returning nil for domain ", domain)
return nil
}
type CacheServerFactory struct{}
func (this CacheServerFactory) Create(space app.Space, config interface{}) (app.Application, error) {
server := NewCacheServer(space, config.(*Config))
return server, nil
}
func (this CacheServerFactory) AppId() app.ID {
return APP_ID
}
func init() {
app.RegisterApplicationFactory(loader.GetType(new(Config)), CacheServerFactory{})
}