1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-17 18:06:15 -05:00

add shadowsocks in json config

This commit is contained in:
Darien Raymond 2016-11-05 01:01:30 +01:00
parent 817cc8d82e
commit c84629c374
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -21,9 +21,10 @@ var (
}, "protocol", "settings")
outboundConfigLoader = NewJSONConfigLoader(ConfigCreatorCache{
"blackhole": func() interface{} { return new(BlackholeConfig) },
"freedom": func() interface{} { return new(FreedomConfig) },
"vmess": func() interface{} { return new(VMessOutboundConfig) },
"blackhole": func() interface{} { return new(BlackholeConfig) },
"freedom": func() interface{} { return new(FreedomConfig) },
"shadowsocks": func() interface{} { return new(ShadowsocksClientConfig) },
"vmess": func() interface{} { return new(VMessOutboundConfig) },
}, "protocol", "settings")
)
@ -59,7 +60,7 @@ func (this *InboundConnectionConfig) Build() (*core.InboundConnectionConfig, err
jsonConfig, err := inboundConfigLoader.LoadWithID(this.Settings, this.Protocol)
if err != nil {
return nil, err
return nil, errors.New("Failed to load inbound config: " + err.Error())
}
ts, err := jsonConfig.(Buildable).Build()
if err != nil {
@ -80,7 +81,7 @@ func (this *OutboundConnectionConfig) Build() (*core.OutboundConnectionConfig, e
config := new(core.OutboundConnectionConfig)
rawConfig, err := outboundConfigLoader.LoadWithID(this.Settings, this.Protocol)
if err != nil {
return nil, err
return nil, errors.New("Failed to parse outbound config: " + err.Error())
}
ts, err := rawConfig.(Buildable).Build()
if err != nil {
@ -181,7 +182,7 @@ func (this *InboundDetourConfig) Build() (*core.InboundConnectionConfig, error)
rawConfig, err := inboundConfigLoader.LoadWithID(this.Settings, this.Protocol)
if err != nil {
return nil, err
return nil, errors.New("Failed to load inbound detour config: " + err.Error())
}
ts, err := rawConfig.(Buildable).Build()
if err != nil {
@ -221,7 +222,7 @@ func (this *OutboundDetourConfig) Build() (*core.OutboundConnectionConfig, error
rawConfig, err := outboundConfigLoader.LoadWithID(this.Settings, this.Protocol)
if err != nil {
return nil, err
return nil, errors.New("Failed to parse to outbound detour config: " + err.Error())
}
ts, err := rawConfig.(Buildable).Build()
if err != nil {