add network list to shadowsocks server

This commit is contained in:
Darien Raymond
2018-04-03 17:51:01 +02:00
parent 8bc20c8656
commit 074dfbb78c
5 changed files with 74 additions and 39 deletions
+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 {