unified config loader

This commit is contained in:
v2ray committed 2016-06-10 22:26:39 +02:00
1 parent 3f7b70a465
commit e732ba62a6
18 files changed
+257 -215

No files matched your search

+1 -6
View File
@@ -9,7 +9,6 @@ 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/internal/config"
)
func (this *Config) UnmarshalJSON(data []byte) error {
@@ -62,9 +61,5 @@ func (this *Config) UnmarshalJSON(data []byte) error {
}
func init() {
config.RegisterInboundConfig("shadowsocks", func(data []byte) (interface{}, error) {
rawConfig := new(Config)
err := json.Unmarshal(data, rawConfig)
return rawConfig, err
})
internal.RegisterInboundConfig("shadowsocks", func() interface{} { return new(Config) })
}