mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-23 21:56:06 +03:00
00bcd40c34
* remove deprecate ciphers in shadowsocks Co-authored-by: Kslr <kslrwang@gmail.com>
37 lines
831 B
Go
37 lines
831 B
Go
package conf_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/xtls/xray-core/common/net"
|
|
"github.com/xtls/xray-core/common/protocol"
|
|
"github.com/xtls/xray-core/common/serial"
|
|
. "github.com/xtls/xray-core/infra/conf"
|
|
"github.com/xtls/xray-core/proxy/shadowsocks"
|
|
)
|
|
|
|
func TestShadowsocksServerConfigParsing(t *testing.T) {
|
|
creator := func() Buildable {
|
|
return new(ShadowsocksServerConfig)
|
|
}
|
|
|
|
runMultiTestCase(t, []TestCase{
|
|
{
|
|
Input: `{
|
|
"method": "aes-256-GCM",
|
|
"password": "xray-password"
|
|
}`,
|
|
Parser: loadJSON(creator),
|
|
Output: &shadowsocks.ServerConfig{
|
|
Users: []*protocol.User{{
|
|
Account: serial.ToTypedMessage(&shadowsocks.Account{
|
|
CipherType: shadowsocks.CipherType_AES_256_GCM,
|
|
Password: "xray-password",
|
|
}),
|
|
}},
|
|
Network: []net.Network{net.Network_TCP},
|
|
},
|
|
},
|
|
})
|
|
}
|