1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-18 03:29:12 -04:00

overrideable dns

This commit is contained in:
Darien Raymond
2017-12-19 23:55:09 +01:00
parent 7d11286d80
commit ab4f245313
11 changed files with 74 additions and 85 deletions

View File

@@ -5,11 +5,9 @@ import (
"v2ray.com/core/app"
"v2ray.com/core/app/dispatcher"
"v2ray.com/core/app/dns"
"v2ray.com/core/app/policy"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
)
// Server is an instance of V2Ray. At any time, there must be at most one Server instance running.
@@ -84,19 +82,6 @@ func newSimpleServer(config *Config) (*simpleServer, error) {
inboundHandlerManager = o.(proxyman.InboundHandlerManager)
}
if dns.FromSpace(space) == nil {
dnsConfig := &dns.Config{
NameServers: []*net.Endpoint{{
Address: net.NewIPOrDomain(net.LocalHostDomain),
}},
}
d, err := app.CreateAppFromConfig(ctx, dnsConfig)
if err != nil {
return nil, err
}
common.Must(space.AddApplication(d))
}
if disp := dispatcher.FromSpace(space); disp == nil {
d, err := app.CreateAppFromConfig(ctx, new(dispatcher.Config))
if err != nil {