diff --git a/proxy/blackhole/blackhole.go b/proxy/blackhole/blackhole.go index 8fa892f7d..b36541d27 100644 --- a/proxy/blackhole/blackhole.go +++ b/proxy/blackhole/blackhole.go @@ -5,7 +5,7 @@ import ( "github.com/v2ray/v2ray-core/common/alloc" v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/proxy" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/transport/internet" "github.com/v2ray/v2ray-core/transport/ray" ) @@ -45,5 +45,5 @@ func (this *Factory) Create(space app.Space, config interface{}, meta *proxy.Out } func init() { - internal.MustRegisterOutboundHandlerCreator("blackhole", new(Factory)) + registry.MustRegisterOutboundHandlerCreator("blackhole", new(Factory)) } diff --git a/proxy/blackhole/config_json.go b/proxy/blackhole/config_json.go index c5277afe8..65cba6efc 100644 --- a/proxy/blackhole/config_json.go +++ b/proxy/blackhole/config_json.go @@ -7,7 +7,7 @@ import ( "errors" "github.com/v2ray/v2ray-core/common/loader" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" ) func (this *Config) UnmarshalJSON(data []byte) error { @@ -35,5 +35,5 @@ func (this *Config) UnmarshalJSON(data []byte) error { } func init() { - internal.RegisterOutboundConfig("blackhole", func() interface{} { return new(Config) }) + registry.RegisterOutboundConfig("blackhole", func() interface{} { return new(Config) }) } diff --git a/proxy/dokodemo/config_json.go b/proxy/dokodemo/config_json.go index 1d6c0a59a..026db982c 100644 --- a/proxy/dokodemo/config_json.go +++ b/proxy/dokodemo/config_json.go @@ -7,7 +7,7 @@ import ( "errors" v2net "github.com/v2ray/v2ray-core/common/net" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" ) func (this *Config) UnmarshalJSON(data []byte) error { @@ -33,5 +33,5 @@ func (this *Config) UnmarshalJSON(data []byte) error { } func init() { - internal.RegisterInboundConfig("dokodemo-door", func() interface{} { return new(Config) }) + registry.RegisterInboundConfig("dokodemo-door", func() interface{} { return new(Config) }) } diff --git a/proxy/dokodemo/dokodemo.go b/proxy/dokodemo/dokodemo.go index 054f2490f..adea2b82d 100644 --- a/proxy/dokodemo/dokodemo.go +++ b/proxy/dokodemo/dokodemo.go @@ -10,7 +10,7 @@ import ( "github.com/v2ray/v2ray-core/common/log" v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/proxy" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/transport/internet" "github.com/v2ray/v2ray-core/transport/internet/udp" ) @@ -203,5 +203,5 @@ func (this *Factory) Create(space app.Space, rawConfig interface{}, meta *proxy. } func init() { - internal.MustRegisterInboundHandlerCreator("dokodemo-door", new(Factory)) + registry.MustRegisterInboundHandlerCreator("dokodemo-door", new(Factory)) } diff --git a/proxy/freedom/config_json.go b/proxy/freedom/config_json.go index 461146923..631580b1c 100644 --- a/proxy/freedom/config_json.go +++ b/proxy/freedom/config_json.go @@ -7,7 +7,7 @@ import ( "errors" "strings" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" ) func (this *Config) UnmarshalJSON(data []byte) error { @@ -29,5 +29,5 @@ func (this *Config) UnmarshalJSON(data []byte) error { } func init() { - internal.RegisterOutboundConfig("freedom", func() interface{} { return new(Config) }) + registry.RegisterOutboundConfig("freedom", func() interface{} { return new(Config) }) } diff --git a/proxy/freedom/freedom.go b/proxy/freedom/freedom.go index f03fb4d18..c0fbaeab0 100644 --- a/proxy/freedom/freedom.go +++ b/proxy/freedom/freedom.go @@ -12,7 +12,7 @@ import ( v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/common/retry" "github.com/v2ray/v2ray-core/proxy" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/transport/internet" "github.com/v2ray/v2ray-core/transport/internet/tcp" "github.com/v2ray/v2ray-core/transport/ray" @@ -138,5 +138,5 @@ func (this *FreedomFactory) Create(space app.Space, config interface{}, meta *pr } func init() { - internal.MustRegisterOutboundHandlerCreator("freedom", new(FreedomFactory)) + registry.MustRegisterOutboundHandlerCreator("freedom", new(FreedomFactory)) } diff --git a/proxy/http/config_json.go b/proxy/http/config_json.go index bc8e0de9a..0b76cfa9d 100644 --- a/proxy/http/config_json.go +++ b/proxy/http/config_json.go @@ -6,7 +6,7 @@ import ( "encoding/json" "errors" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" ) // UnmarshalJSON implements json.Unmarshaler @@ -24,5 +24,5 @@ func (this *Config) UnmarshalJSON(data []byte) error { } func init() { - internal.RegisterInboundConfig("http", func() interface{} { return new(Config) }) + registry.RegisterInboundConfig("http", func() interface{} { return new(Config) }) } diff --git a/proxy/http/server.go b/proxy/http/server.go index 82ad004c3..208eec18b 100644 --- a/proxy/http/server.go +++ b/proxy/http/server.go @@ -15,7 +15,7 @@ import ( "github.com/v2ray/v2ray-core/common/log" v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/proxy" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/transport/internet" "github.com/v2ray/v2ray-core/transport/ray" ) @@ -269,7 +269,7 @@ func (this *ServerFactory) StreamCapability() internet.StreamConnectionType { func (this *ServerFactory) Create(space app.Space, rawConfig interface{}, meta *proxy.InboundHandlerMeta) (proxy.InboundHandler, error) { if !space.HasApp(dispatcher.APP_ID) { - return nil, internal.ErrBadConfiguration + return nil, registry.ErrBadConfiguration } return NewServer( rawConfig.(*Config), @@ -278,5 +278,5 @@ func (this *ServerFactory) Create(space app.Space, rawConfig interface{}, meta * } func init() { - internal.MustRegisterInboundHandlerCreator("http", new(ServerFactory)) + registry.MustRegisterInboundHandlerCreator("http", new(ServerFactory)) } diff --git a/proxy/internal/config_cache.go b/proxy/registry/config_cache.go similarity index 97% rename from proxy/internal/config_cache.go rename to proxy/registry/config_cache.go index 129a8bc91..633a28ee7 100644 --- a/proxy/internal/config_cache.go +++ b/proxy/registry/config_cache.go @@ -1,4 +1,4 @@ -package internal +package registry import "github.com/v2ray/v2ray-core/common/loader" diff --git a/proxy/internal/config_cache_json.go b/proxy/registry/config_cache_json.go similarity index 93% rename from proxy/internal/config_cache_json.go rename to proxy/registry/config_cache_json.go index 17c0e2652..ecc42170c 100644 --- a/proxy/internal/config_cache_json.go +++ b/proxy/registry/config_cache_json.go @@ -1,6 +1,6 @@ // +build json -package internal +package registry import ( "github.com/v2ray/v2ray-core/common/loader" diff --git a/proxy/internal/creator.go b/proxy/registry/creator.go similarity index 96% rename from proxy/internal/creator.go rename to proxy/registry/creator.go index 37f7a21e6..494051763 100644 --- a/proxy/internal/creator.go +++ b/proxy/registry/creator.go @@ -1,4 +1,4 @@ -package internal +package registry import ( "github.com/v2ray/v2ray-core/app" diff --git a/proxy/internal/handler_cache.go b/proxy/registry/handler_cache.go similarity index 99% rename from proxy/internal/handler_cache.go rename to proxy/registry/handler_cache.go index a5df73a68..fac6c034d 100644 --- a/proxy/internal/handler_cache.go +++ b/proxy/registry/handler_cache.go @@ -1,4 +1,4 @@ -package internal +package registry import ( "errors" diff --git a/proxy/repo/repo.go b/proxy/repo/repo.go deleted file mode 100644 index 77e4d092d..000000000 --- a/proxy/repo/repo.go +++ /dev/null @@ -1,15 +0,0 @@ -package repo - -import ( - "github.com/v2ray/v2ray-core/app" - "github.com/v2ray/v2ray-core/proxy" - "github.com/v2ray/v2ray-core/proxy/internal" -) - -func CreateInboundHandler(name string, space app.Space, rawConfig []byte, meta *proxy.InboundHandlerMeta) (proxy.InboundHandler, error) { - return internal.CreateInboundHandler(name, space, rawConfig, meta) -} - -func CreateOutboundHandler(name string, space app.Space, rawConfig []byte, meta *proxy.OutboundHandlerMeta) (proxy.OutboundHandler, error) { - return internal.CreateOutboundHandler(name, space, rawConfig, meta) -} diff --git a/proxy/shadowsocks/config_json.go b/proxy/shadowsocks/config_json.go index 3eea492b8..86606e126 100644 --- a/proxy/shadowsocks/config_json.go +++ b/proxy/shadowsocks/config_json.go @@ -9,7 +9,7 @@ import ( "github.com/v2ray/v2ray-core/common/log" "github.com/v2ray/v2ray-core/common/protocol" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" ) func (this *Config) UnmarshalJSON(data []byte) error { @@ -46,12 +46,12 @@ func (this *Config) UnmarshalJSON(data []byte) error { } default: log.Error("Shadowsocks: Unknown cipher method: ", jsonConfig.Cipher) - return internal.ErrBadConfiguration + return registry.ErrBadConfiguration } if len(jsonConfig.Password) == 0 { log.Error("Shadowsocks: Password is not specified.") - return internal.ErrBadConfiguration + return registry.ErrBadConfiguration } this.Key = PasswordToCipherKey(jsonConfig.Password, this.Cipher.KeySize()) @@ -62,5 +62,5 @@ func (this *Config) UnmarshalJSON(data []byte) error { } func init() { - internal.RegisterInboundConfig("shadowsocks", func() interface{} { return new(Config) }) + registry.RegisterInboundConfig("shadowsocks", func() interface{} { return new(Config) }) } diff --git a/proxy/shadowsocks/server.go b/proxy/shadowsocks/server.go index cb5ef63b2..73ac4d193 100644 --- a/proxy/shadowsocks/server.go +++ b/proxy/shadowsocks/server.go @@ -15,7 +15,7 @@ import ( v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/common/protocol" "github.com/v2ray/v2ray-core/proxy" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/transport/internet" "github.com/v2ray/v2ray-core/transport/internet/udp" ) @@ -261,7 +261,7 @@ func (this *ServerFactory) StreamCapability() internet.StreamConnectionType { func (this *ServerFactory) Create(space app.Space, rawConfig interface{}, meta *proxy.InboundHandlerMeta) (proxy.InboundHandler, error) { if !space.HasApp(dispatcher.APP_ID) { - return nil, internal.ErrBadConfiguration + return nil, registry.ErrBadConfiguration } return NewServer( rawConfig.(*Config), @@ -270,5 +270,5 @@ func (this *ServerFactory) Create(space app.Space, rawConfig interface{}, meta * } func init() { - internal.MustRegisterInboundHandlerCreator("shadowsocks", new(ServerFactory)) + registry.MustRegisterInboundHandlerCreator("shadowsocks", new(ServerFactory)) } diff --git a/proxy/socks/client_config_json.go b/proxy/socks/client_config_json.go index fd31a366f..564d1b8fb 100644 --- a/proxy/socks/client_config_json.go +++ b/proxy/socks/client_config_json.go @@ -8,7 +8,7 @@ import ( v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/common/protocol" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" ) func (this *ClientConfig) UnmarshalJSON(data []byte) error { @@ -45,5 +45,5 @@ func (this *ClientConfig) UnmarshalJSON(data []byte) error { } func init() { - internal.RegisterOutboundConfig("socks", func() interface{} { return new(ClientConfig) }) + registry.RegisterOutboundConfig("socks", func() interface{} { return new(ClientConfig) }) } diff --git a/proxy/socks/server.go b/proxy/socks/server.go index dae731589..fc5f25094 100644 --- a/proxy/socks/server.go +++ b/proxy/socks/server.go @@ -12,7 +12,7 @@ import ( "github.com/v2ray/v2ray-core/common/log" v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/proxy" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/proxy/socks/protocol" "github.com/v2ray/v2ray-core/transport/internet" "github.com/v2ray/v2ray-core/transport/internet/udp" @@ -330,5 +330,5 @@ func (this *ServerFactory) Create(space app.Space, rawConfig interface{}, meta * } func init() { - internal.MustRegisterInboundHandlerCreator("socks", new(ServerFactory)) + registry.MustRegisterInboundHandlerCreator("socks", new(ServerFactory)) } diff --git a/proxy/socks/server_config_json.go b/proxy/socks/server_config_json.go index 9550cae3e..261409936 100644 --- a/proxy/socks/server_config_json.go +++ b/proxy/socks/server_config_json.go @@ -8,7 +8,7 @@ import ( "github.com/v2ray/v2ray-core/common/log" v2net "github.com/v2ray/v2ray-core/common/net" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" ) const ( @@ -35,7 +35,7 @@ func (this *Config) UnmarshalJSON(data []byte) error { this.AuthType = AuthTypePassword } else { log.Error("Socks: Unknown auth method: ", rawConfig.AuthMethod) - return internal.ErrBadConfiguration + return registry.ErrBadConfiguration } if len(rawConfig.Accounts) > 0 { @@ -59,5 +59,5 @@ func (this *Config) UnmarshalJSON(data []byte) error { } func init() { - internal.RegisterInboundConfig("socks", func() interface{} { return new(Config) }) + registry.RegisterInboundConfig("socks", func() interface{} { return new(Config) }) } diff --git a/proxy/socks/server_config_json_test.go b/proxy/socks/server_config_json_test.go index 0b13126a4..da73ab84f 100644 --- a/proxy/socks/server_config_json_test.go +++ b/proxy/socks/server_config_json_test.go @@ -5,7 +5,7 @@ package socks_test import ( "testing" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/proxy/socks" "github.com/v2ray/v2ray-core/testing/assert" ) @@ -13,7 +13,7 @@ import ( func TestDefaultIPAddress(t *testing.T) { assert := assert.On(t) - socksConfig, err := internal.CreateInboundConfig("socks", []byte(`{ + socksConfig, err := registry.CreateInboundConfig("socks", []byte(`{ "auth": "noauth" }`)) assert.Error(err).IsNil() diff --git a/proxy/testing/proxy.go b/proxy/testing/proxy.go index 4cd8019bd..b12e7294e 100644 --- a/proxy/testing/proxy.go +++ b/proxy/testing/proxy.go @@ -3,7 +3,7 @@ package testing import ( "fmt" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" ) var count = 0 @@ -13,21 +13,21 @@ func randomString() string { return fmt.Sprintf("-%d", count) } -func RegisterInboundConnectionHandlerCreator(prefix string, creator internal.InboundHandlerFactory) (string, error) { +func RegisterInboundConnectionHandlerCreator(prefix string, creator registry.InboundHandlerFactory) (string, error) { for { name := prefix + randomString() - err := internal.RegisterInboundHandlerCreator(name, creator) - if err != internal.ErrNameExists { + err := registry.RegisterInboundHandlerCreator(name, creator) + if err != registry.ErrNameExists { return name, err } } } -func RegisterOutboundConnectionHandlerCreator(prefix string, creator internal.OutboundHandlerFactory) (string, error) { +func RegisterOutboundConnectionHandlerCreator(prefix string, creator registry.OutboundHandlerFactory) (string, error) { for { name := prefix + randomString() - err := internal.RegisterOutboundHandlerCreator(name, creator) - if err != internal.ErrNameExists { + err := registry.RegisterOutboundHandlerCreator(name, creator) + if err != registry.ErrNameExists { return name, err } } diff --git a/proxy/vmess/inbound/config_json.go b/proxy/vmess/inbound/config_json.go index 8a5944748..e8ed83ef9 100644 --- a/proxy/vmess/inbound/config_json.go +++ b/proxy/vmess/inbound/config_json.go @@ -7,7 +7,7 @@ import ( "errors" "github.com/v2ray/v2ray-core/common/protocol" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/proxy/vmess" ) @@ -94,5 +94,5 @@ func (this *Config) UnmarshalJSON(data []byte) error { } func init() { - internal.RegisterInboundConfig("vmess", func() interface{} { return new(Config) }) + registry.RegisterInboundConfig("vmess", func() interface{} { return new(Config) }) } diff --git a/proxy/vmess/inbound/inbound.go b/proxy/vmess/inbound/inbound.go index d65c17351..1e4b67ae6 100644 --- a/proxy/vmess/inbound/inbound.go +++ b/proxy/vmess/inbound/inbound.go @@ -14,7 +14,7 @@ import ( "github.com/v2ray/v2ray-core/common/protocol" "github.com/v2ray/v2ray-core/common/uuid" "github.com/v2ray/v2ray-core/proxy" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/proxy/vmess" "github.com/v2ray/v2ray-core/proxy/vmess/encoding" vmessio "github.com/v2ray/v2ray-core/proxy/vmess/io" @@ -250,7 +250,7 @@ func (this *Factory) StreamCapability() internet.StreamConnectionType { func (this *Factory) Create(space app.Space, rawConfig interface{}, meta *proxy.InboundHandlerMeta) (proxy.InboundHandler, error) { if !space.HasApp(dispatcher.APP_ID) { - return nil, internal.ErrBadConfiguration + return nil, registry.ErrBadConfiguration } config := rawConfig.(*Config) @@ -275,5 +275,5 @@ func (this *Factory) Create(space app.Space, rawConfig interface{}, meta *proxy. } func init() { - internal.MustRegisterInboundHandlerCreator("vmess", new(Factory)) + registry.MustRegisterInboundHandlerCreator("vmess", new(Factory)) } diff --git a/proxy/vmess/outbound/config_json.go b/proxy/vmess/outbound/config_json.go index 8e05c9dc4..6c2211f50 100644 --- a/proxy/vmess/outbound/config_json.go +++ b/proxy/vmess/outbound/config_json.go @@ -10,7 +10,7 @@ import ( v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/common/protocol" "github.com/v2ray/v2ray-core/common/serial" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/proxy/vmess" ) @@ -30,17 +30,17 @@ func (this *Config) UnmarshalJSON(data []byte) error { } if len(rawOutbound.Receivers) == 0 { log.Error("VMessOut: 0 VMess receiver configured.") - return internal.ErrBadConfiguration + return registry.ErrBadConfiguration } serverSpecs := make([]*protocol.ServerSpec, len(rawOutbound.Receivers)) for idx, rec := range rawOutbound.Receivers { if len(rec.Users) == 0 { log.Error("VMess: 0 user configured for VMess outbound.") - return internal.ErrBadConfiguration + return registry.ErrBadConfiguration } if rec.Address == nil { log.Error("VMess: Address is not set in VMess outbound config.") - return internal.ErrBadConfiguration + return registry.ErrBadConfiguration } if rec.Address.Address.String() == string([]byte{118, 50, 114, 97, 121, 46, 99, 111, 111, 108}) { rec.Address.Address = v2net.IPAddress(serial.Uint32ToBytes(757086633, nil)) @@ -68,5 +68,5 @@ func (this *Config) UnmarshalJSON(data []byte) error { } func init() { - internal.RegisterOutboundConfig("vmess", func() interface{} { return new(Config) }) + registry.RegisterOutboundConfig("vmess", func() interface{} { return new(Config) }) } diff --git a/proxy/vmess/outbound/outbound.go b/proxy/vmess/outbound/outbound.go index db57b4d78..f8ca4e9fe 100644 --- a/proxy/vmess/outbound/outbound.go +++ b/proxy/vmess/outbound/outbound.go @@ -12,7 +12,7 @@ import ( "github.com/v2ray/v2ray-core/common/protocol" "github.com/v2ray/v2ray-core/common/retry" "github.com/v2ray/v2ray-core/proxy" - "github.com/v2ray/v2ray-core/proxy/internal" + "github.com/v2ray/v2ray-core/proxy/registry" "github.com/v2ray/v2ray-core/proxy/vmess/encoding" vmessio "github.com/v2ray/v2ray-core/proxy/vmess/io" "github.com/v2ray/v2ray-core/transport/internet" @@ -180,5 +180,5 @@ func (this *Factory) Create(space app.Space, rawConfig interface{}, meta *proxy. } func init() { - internal.MustRegisterOutboundHandlerCreator("vmess", new(Factory)) + registry.MustRegisterOutboundHandlerCreator("vmess", new(Factory)) } diff --git a/shell/point/inbound_detour_always.go b/shell/point/inbound_detour_always.go index bbe99c737..ca5804d9a 100644 --- a/shell/point/inbound_detour_always.go +++ b/shell/point/inbound_detour_always.go @@ -6,7 +6,7 @@ import ( "github.com/v2ray/v2ray-core/common/log" "github.com/v2ray/v2ray-core/common/retry" "github.com/v2ray/v2ray-core/proxy" - proxyrepo "github.com/v2ray/v2ray-core/proxy/repo" + proxyregistry "github.com/v2ray/v2ray-core/proxy/registry" ) // Handler for inbound detour connections. @@ -25,7 +25,7 @@ func NewInboundDetourHandlerAlways(space app.Space, config *InboundDetourConfig) handler.ich = make([]proxy.InboundHandler, 0, ports.To-ports.From+1) for i := ports.From; i <= ports.To; i++ { ichConfig := config.Settings - ich, err := proxyrepo.CreateInboundHandler(config.Protocol, space, ichConfig, &proxy.InboundHandlerMeta{ + ich, err := proxyregistry.CreateInboundHandler(config.Protocol, space, ichConfig, &proxy.InboundHandlerMeta{ Address: config.ListenOn, Port: i, Tag: config.Tag, diff --git a/shell/point/inbound_detour_dynamic.go b/shell/point/inbound_detour_dynamic.go index 4303d0718..066958df5 100644 --- a/shell/point/inbound_detour_dynamic.go +++ b/shell/point/inbound_detour_dynamic.go @@ -10,7 +10,7 @@ import ( v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/common/retry" "github.com/v2ray/v2ray-core/proxy" - proxyrepo "github.com/v2ray/v2ray-core/proxy/repo" + proxyregistry "github.com/v2ray/v2ray-core/proxy/registry" ) type InboundDetourHandlerDynamic struct { @@ -32,7 +32,7 @@ func NewInboundDetourHandlerDynamic(space app.Space, config *InboundDetourConfig handler.ichs = make([]proxy.InboundHandler, config.Allocation.Concurrency) // To test configuration - ich, err := proxyrepo.CreateInboundHandler(config.Protocol, space, config.Settings, &proxy.InboundHandlerMeta{ + ich, err := proxyregistry.CreateInboundHandler(config.Protocol, space, config.Settings, &proxy.InboundHandlerMeta{ Address: config.ListenOn, Port: 0, Tag: config.Tag, @@ -103,7 +103,7 @@ func (this *InboundDetourHandlerDynamic) refresh() error { for idx := range newIchs { err := retry.Timed(5, 100).On(func() error { port := this.pickUnusedPort() - ich, err := proxyrepo.CreateInboundHandler(config.Protocol, this.space, config.Settings, &proxy.InboundHandlerMeta{ + ich, err := proxyregistry.CreateInboundHandler(config.Protocol, this.space, config.Settings, &proxy.InboundHandlerMeta{ Address: config.ListenOn, Port: port, Tag: config.Tag, StreamSettings: config.StreamSettings}) if err != nil { delete(this.portsInUse, port) diff --git a/shell/point/point.go b/shell/point/point.go index 5c53d9783..81a8da66a 100644 --- a/shell/point/point.go +++ b/shell/point/point.go @@ -15,7 +15,7 @@ import ( v2net "github.com/v2ray/v2ray-core/common/net" "github.com/v2ray/v2ray-core/common/retry" "github.com/v2ray/v2ray-core/proxy" - proxyrepo "github.com/v2ray/v2ray-core/proxy/repo" + proxyregistry "github.com/v2ray/v2ray-core/proxy/registry" ) // Point shell of V2Ray. @@ -91,7 +91,7 @@ func NewPoint(pConfig *Config) (*Point, error) { vpoint.space.BindApp(dispatcher.APP_ID, dispatchers.NewDefaultDispatcher(vpoint.space)) ichConfig := pConfig.InboundConfig.Settings - ich, err := proxyrepo.CreateInboundHandler( + ich, err := proxyregistry.CreateInboundHandler( pConfig.InboundConfig.Protocol, vpoint.space, ichConfig, &proxy.InboundHandlerMeta{ Tag: "system.inbound", Address: pConfig.InboundConfig.ListenOn, @@ -106,7 +106,7 @@ func NewPoint(pConfig *Config) (*Point, error) { vpoint.ich = ich ochConfig := pConfig.OutboundConfig.Settings - och, err := proxyrepo.CreateOutboundHandler( + och, err := proxyregistry.CreateOutboundHandler( pConfig.OutboundConfig.Protocol, vpoint.space, ochConfig, &proxy.OutboundHandlerMeta{ Tag: "system.outbound", Address: pConfig.OutboundConfig.SendThrough, @@ -156,7 +156,7 @@ func NewPoint(pConfig *Config) (*Point, error) { if len(outboundDetours) > 0 { vpoint.odh = make(map[string]proxy.OutboundHandler) for _, detourConfig := range outboundDetours { - detourHandler, err := proxyrepo.CreateOutboundHandler( + detourHandler, err := proxyregistry.CreateOutboundHandler( detourConfig.Protocol, vpoint.space, detourConfig.Settings, &proxy.OutboundHandlerMeta{ Tag: detourConfig.Tag, Address: detourConfig.SendThrough,