예제 #1
0
func TestStringNetworkList(t *testing.T) {
	assert := assert.On(t)

	var list NetworkList
	err := json.Unmarshal([]byte("\"TCP, ip\""), &list)
	assert.Error(err).IsNil()

	nlist := list.Build()
	assert.Bool(nlist.HasNetwork(v2net.ParseNetwork("tcp"))).IsTrue()
	assert.Bool(nlist.HasNetwork(v2net.ParseNetwork("udp"))).IsFalse()
}
예제 #2
0
func (this Network) Build() v2net.Network {
	return v2net.ParseNetwork(string(this))
}
예제 #3
0
파일: common.go 프로젝트: ylywyn/v2ray-core
func (v Network) Build() v2net.Network {
	return v2net.ParseNetwork(string(v))
}