add network list to shadowsocks server

This commit is contained in:
Darien Raymond committed 2018-04-03 17:51:01 +02:00
1 parent 8bc20c8656
commit 074dfbb78c
5 files changed
+74 -39

No files matched your search

+9
View File
@@ -46,6 +46,15 @@ func (n Network) URLPrefix() string {
}
}
func HasNetwork(list []Network, network Network) bool {
for _, value := range list {
if string(value) == string(network) {
return true
}
}
return false
}
// HasNetwork returns true if the given network is in v NetworkList.
func (l NetworkList) HasNetwork(network Network) bool {
for _, value := range l.Network {