mirror of https://github.com/XTLS/Xray-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.
36 lines
841 B
36 lines
841 B
package conf_test |
|
|
|
import ( |
|
"testing" |
|
|
|
"github.com/xtls/xray-core/v1/common/net" |
|
"github.com/xtls/xray-core/v1/common/protocol" |
|
"github.com/xtls/xray-core/v1/common/serial" |
|
. "github.com/xtls/xray-core/v1/infra/conf" |
|
"github.com/xtls/xray-core/v1/proxy/shadowsocks" |
|
) |
|
|
|
func TestShadowsocksServerConfigParsing(t *testing.T) { |
|
creator := func() Buildable { |
|
return new(ShadowsocksServerConfig) |
|
} |
|
|
|
runMultiTestCase(t, []TestCase{ |
|
{ |
|
Input: `{ |
|
"method": "aes-128-cfb", |
|
"password": "xray-password" |
|
}`, |
|
Parser: loadJSON(creator), |
|
Output: &shadowsocks.ServerConfig{ |
|
User: &protocol.User{ |
|
Account: serial.ToTypedMessage(&shadowsocks.Account{ |
|
CipherType: shadowsocks.CipherType_AES_128_CFB, |
|
Password: "xray-password", |
|
}), |
|
}, |
|
Network: []net.Network{net.Network_TCP}, |
|
}, |
|
}, |
|
}) |
|
}
|
|
|