mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
rename RegisterInboundConnectionConfig to RegisterInboundConfig
This commit is contained in:
parent
9fe8178e4a
commit
01ed2fa889
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
config.RegisterOutboundConnectionConfig("blackhole",
|
||||
config.RegisterOutboundConfig("blackhole",
|
||||
func(data []byte) (interface{}, error) {
|
||||
return new(Config), nil
|
||||
})
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
config.RegisterInboundConnectionConfig("dokodemo-door",
|
||||
config.RegisterInboundConfig("dokodemo-door",
|
||||
func(data []byte) (interface{}, error) {
|
||||
type DokodemoConfig struct {
|
||||
Host *v2net.AddressJson `json:"address"`
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
config.RegisterOutboundConnectionConfig("freedom",
|
||||
config.RegisterOutboundConfig("freedom",
|
||||
func(data []byte) (interface{}, error) {
|
||||
return new(Config), nil
|
||||
})
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
config.RegisterInboundConnectionConfig("http",
|
||||
config.RegisterInboundConfig("http",
|
||||
func(data []byte) (interface{}, error) {
|
||||
return new(Config), nil
|
||||
})
|
||||
|
@ -20,11 +20,11 @@ func registerConfigType(protocol string, proxyType string, creator ConfigObjectC
|
||||
return nil
|
||||
}
|
||||
|
||||
func RegisterInboundConnectionConfig(protocol string, creator ConfigObjectCreator) error {
|
||||
func RegisterInboundConfig(protocol string, creator ConfigObjectCreator) error {
|
||||
return registerConfigType(protocol, "inbound", creator)
|
||||
}
|
||||
|
||||
func RegisterOutboundConnectionConfig(protocol string, creator ConfigObjectCreator) error {
|
||||
func RegisterOutboundConfig(protocol string, creator ConfigObjectCreator) error {
|
||||
return registerConfigType(protocol, "outbound", creator)
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ func TestRegisterInboundConfig(t *testing.T) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
err := RegisterInboundConnectionConfig(protocol, creator)
|
||||
err := RegisterInboundConfig(protocol, creator)
|
||||
assert.Error(err).IsNil()
|
||||
|
||||
configObj, err := CreateInboundConnectionConfig(protocol, nil)
|
||||
@ -36,7 +36,7 @@ func TestRegisterOutboundConfig(t *testing.T) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
err := RegisterOutboundConnectionConfig(protocol, creator)
|
||||
err := RegisterOutboundConfig(protocol, creator)
|
||||
assert.Error(err).IsNil()
|
||||
|
||||
configObj, err := CreateOutboundConnectionConfig(protocol, nil)
|
||||
|
@ -17,7 +17,7 @@ const (
|
||||
)
|
||||
|
||||
func init() {
|
||||
config.RegisterInboundConnectionConfig("socks",
|
||||
config.RegisterInboundConfig("socks",
|
||||
func(data []byte) (interface{}, error) {
|
||||
type SocksAccount struct {
|
||||
Username string `json:"user"`
|
||||
|
@ -48,7 +48,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
|
||||
func init() {
|
||||
config.RegisterInboundConnectionConfig("vmess",
|
||||
config.RegisterInboundConfig("vmess",
|
||||
func(data []byte) (interface{}, error) {
|
||||
config := new(Config)
|
||||
err := json.Unmarshal(data, config)
|
||||
|
@ -28,7 +28,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proxyconfig.RegisterOutboundConnectionConfig("vmess",
|
||||
proxyconfig.RegisterOutboundConfig("vmess",
|
||||
func(data []byte) (interface{}, error) {
|
||||
rawConfig := new(Config)
|
||||
if err := json.Unmarshal(data, rawConfig); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user