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:
15
v2ray.go
15
v2ray.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user