feat(protonvpn): feature filters (#2182)

- `SECURE_CORE_ONLY`
- `TOR_ONLY`
- `P2P_ONLY`
This commit is contained in:
Koen van Zuijlen
2024-07-29 08:57:31 +02:00
committed by GitHub
parent 2bf2525bc5
commit cb99f90bb5
11 changed files with 7007 additions and 2933 deletions

View File

@@ -9,8 +9,15 @@ import (
type ipToServer map[string]models.Server
type features struct {
secureCore bool
tor bool
p2p bool
stream bool
}
func (its ipToServer) add(country, region, city, name, hostname string,
free bool, entryIP netip.Addr) {
free bool, entryIP netip.Addr, features features) {
key := entryIP.String()
server, ok := its[key]
@@ -25,6 +32,10 @@ func (its ipToServer) add(country, region, city, name, hostname string,
server.ServerName = name
server.Hostname = hostname
server.Free = free
server.SecureCore = features.secureCore
server.Tor = features.tor
server.P2P = features.p2p
server.Stream = features.stream
server.UDP = true
server.TCP = true
server.IPs = []netip.Addr{entryIP}