mirror of https://github.com/v2ray/v2ray-core
announce deprecated proto settings
parent
97f232cd5d
commit
909cb9b27a
|
@ -1,6 +1,7 @@
|
||||||
package dns
|
package dns
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"v2ray.com/core"
|
||||||
"v2ray.com/core/common"
|
"v2ray.com/core/common"
|
||||||
"v2ray.com/core/common/net"
|
"v2ray.com/core/common/net"
|
||||||
"v2ray.com/core/common/strmatcher"
|
"v2ray.com/core/common/strmatcher"
|
||||||
|
@ -38,6 +39,8 @@ func NewStaticHosts(hosts []*Config_HostMapping, legacy map[string]*net.IPOrDoma
|
||||||
}
|
}
|
||||||
|
|
||||||
if legacy != nil {
|
if legacy != nil {
|
||||||
|
core.PrintDeprecatedFeatureWarning("simple host mapping")
|
||||||
|
|
||||||
for domain, ip := range legacy {
|
for domain, ip := range legacy {
|
||||||
matcher, err := strmatcher.Full.New(domain)
|
matcher, err := strmatcher.Full.New(domain)
|
||||||
common.Must(err)
|
common.Must(err)
|
||||||
|
|
|
@ -60,6 +60,10 @@ func New(ctx context.Context, config *Config) (*Server, error) {
|
||||||
return len(server.servers) - 1
|
return len(server.servers) - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(config.NameServers) > 0 {
|
||||||
|
core.PrintDeprecatedFeatureWarning("simple DNS server")
|
||||||
|
}
|
||||||
|
|
||||||
for _, destPB := range config.NameServers {
|
for _, destPB := range config.NameServers {
|
||||||
addNameServer(destPB)
|
addNameServer(destPB)
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,3 +14,7 @@ func CreateObject(v *Instance, config interface{}) (interface{}, error) {
|
||||||
}
|
}
|
||||||
return common.CreateObject(ctx, config)
|
return common.CreateObject(ctx, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PrintDeprecatedFeatureWarning(feature string) {
|
||||||
|
newError("You are using a deprecated feature: " + feature + ". Please update your config file with latest configuration format, or update your client software.")
|
||||||
|
}
|
||||||
|
|
|
@ -37,6 +37,9 @@ func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) {
|
||||||
func (s *Server) policy() core.Policy {
|
func (s *Server) policy() core.Policy {
|
||||||
config := s.config
|
config := s.config
|
||||||
p := s.v.PolicyManager().ForLevel(config.UserLevel)
|
p := s.v.PolicyManager().ForLevel(config.UserLevel)
|
||||||
|
if config.Timeout > 0 {
|
||||||
|
core.PrintDeprecatedFeatureWarning("Socks timeout")
|
||||||
|
}
|
||||||
if config.Timeout > 0 && config.UserLevel == 0 {
|
if config.Timeout > 0 && config.UserLevel == 0 {
|
||||||
p.Timeouts.ConnectionIdle = time.Duration(config.Timeout) * time.Second
|
p.Timeouts.ConnectionIdle = time.Duration(config.Timeout) * time.Second
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ option java_multiple_files = true;
|
||||||
import "v2ray.com/core/transport/internet/config.proto";
|
import "v2ray.com/core/transport/internet/config.proto";
|
||||||
|
|
||||||
// Global transport settings. This affects all type of connections that go through V2Ray.
|
// Global transport settings. This affects all type of connections that go through V2Ray.
|
||||||
|
// Deprecated. Use each settings in StreamConfig.
|
||||||
message Config {
|
message Config {
|
||||||
repeated v2ray.core.transport.internet.TransportConfig transport_settings = 1;
|
repeated v2ray.core.transport.internet.TransportConfig transport_settings = 1;
|
||||||
}
|
}
|
||||||
|
|
3
v2ray.go
3
v2ray.go
|
@ -45,6 +45,9 @@ func New(config *Config) (*Instance, error) {
|
||||||
id: uuid.New(),
|
id: uuid.New(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.Transport != nil {
|
||||||
|
PrintDeprecatedFeatureWarning("global tranport settings")
|
||||||
|
}
|
||||||
if err := config.Transport.Apply(); err != nil {
|
if err := config.Transport.Apply(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue