mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
773 B
37 lines
773 B
6 years ago
|
package conf_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"v2ray.com/core/common/net"
|
||
|
"v2ray.com/core/common/protocol"
|
||
|
"v2ray.com/core/common/serial"
|
||
|
. "v2ray.com/core/infra/conf"
|
||
|
"v2ray.com/core/proxy/shadowsocks"
|
||
|
)
|
||
|
|
||
|
func TestShadowsocksServerConfigParsing(t *testing.T) {
|
||
|
creator := func() Buildable {
|
||
|
return new(ShadowsocksServerConfig)
|
||
|
}
|
||
|
|
||
|
runMultiTestCase(t, []TestCase{
|
||
|
{
|
||
|
Input: `{
|
||
|
"method": "aes-128-cfb",
|
||
|
"password": "v2ray-password"
|
||
|
}`,
|
||
|
Parser: loadJSON(creator),
|
||
|
Output: &shadowsocks.ServerConfig{
|
||
|
User: &protocol.User{
|
||
|
Account: serial.ToTypedMessage(&shadowsocks.Account{
|
||
|
CipherType: shadowsocks.CipherType_AES_128_CFB,
|
||
|
Password: "v2ray-password",
|
||
|
}),
|
||
|
},
|
||
|
Network: []net.Network{net.Network_TCP},
|
||
|
},
|
||
|
},
|
||
|
})
|
||
|
}
|