mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-17 22:57:10 +00:00
Simpilify configuration files
This commit is contained in:
1 parent
78daf8a879
commit
72b4eeba8b
27 files changed
+251
-208
No files matched your search
@@ -9,6 +9,7 @@ import (
|
||||
"golang.org/x/net/proxy"
|
||||
|
||||
"github.com/v2ray/v2ray-core"
|
||||
"github.com/v2ray/v2ray-core/proxy/socks/config/json"
|
||||
"github.com/v2ray/v2ray-core/testing/mocks"
|
||||
"github.com/v2ray/v2ray-core/testing/unit"
|
||||
)
|
||||
@@ -28,11 +29,13 @@ func TestSocksTcpConnect(t *testing.T) {
|
||||
PortValue: port,
|
||||
InboundConfigValue: &mocks.ConnectionConfig{
|
||||
ProtocolValue: "socks",
|
||||
ContentValue: []byte("{\"auth\": \"noauth\"}"),
|
||||
SettingsValue: &json.SocksConfig{
|
||||
AuthMethod: "noauth",
|
||||
},
|
||||
},
|
||||
OutboundConfigValue: &mocks.ConnectionConfig{
|
||||
ProtocolValue: "mock_och",
|
||||
ContentValue: nil,
|
||||
SettingsValue: nil,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -79,11 +82,15 @@ func TestSocksTcpConnectWithUserPass(t *testing.T) {
|
||||
PortValue: port,
|
||||
InboundConfigValue: &mocks.ConnectionConfig{
|
||||
ProtocolValue: "socks",
|
||||
ContentValue: []byte("{\"auth\": \"password\",\"user\": \"userx\",\"pass\": \"passy\"}"),
|
||||
SettingsValue: &json.SocksConfig{
|
||||
AuthMethod: "noauth",
|
||||
Username: "userx",
|
||||
Password: "passy",
|
||||
},
|
||||
},
|
||||
OutboundConfigValue: &mocks.ConnectionConfig{
|
||||
ProtocolValue: "mock_och",
|
||||
ContentValue: nil,
|
||||
SettingsValue: nil,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -130,11 +137,14 @@ func TestSocksUdpSend(t *testing.T) {
|
||||
PortValue: port,
|
||||
InboundConfigValue: &mocks.ConnectionConfig{
|
||||
ProtocolValue: "socks",
|
||||
ContentValue: []byte("{\"auth\": \"noauth\", \"udp\": true}"),
|
||||
SettingsValue: &json.SocksConfig{
|
||||
AuthMethod: "noauth",
|
||||
UDPEnabled: true,
|
||||
},
|
||||
},
|
||||
OutboundConfigValue: &mocks.ConnectionConfig{
|
||||
ProtocolValue: "mock_och",
|
||||
ContentValue: nil,
|
||||
SettingsValue: nil,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user