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