diff --git a/intra/ipn/warp/cfg.go b/intra/ipn/warp/cfg.go index 6ab0520f..ed571005 100644 --- a/intra/ipn/warp/cfg.go +++ b/intra/ipn/warp/cfg.go @@ -116,8 +116,7 @@ var defaultHeaders = map[string]string{ } // raw.githubusercontent.com/ProtonVPN/android-app/81a6dfb9a0/app/src/main/assets/GuestHoleServers.json -var prebuiltProtonServersJson = []byte(`{ -[ +var prebuiltProtonServersJson = []byte(`[ { "Name": "CH#134", "EntryCountry": "CH", diff --git a/intra/ipn/warp/proton.go b/intra/ipn/warp/proton.go index 91edc93d..968c488f 100644 --- a/intra/ipn/warp/proton.go +++ b/intra/ipn/warp/proton.go @@ -275,7 +275,8 @@ type ProtonCertResponse struct { // github.com/ProtonVPN/android-app/blob/master/app/src/b9c6e59de40/assets/GuestHoleServers.json type ProtonServerResponse struct { - R []ProtonLogicals `json:"ProtonLogicals"` + Code int `json:"Code"` + R []ProtonLogicals `json:"LogicalServers"` } // { @@ -328,9 +329,10 @@ type ProtonLogicals struct { VPNGatewayID string `json:"VPNGatewayID"` ID string `json:"ID"` Load int `json:"Load"` - Location ProtonServerLocation - Status int `json:"Status"` - Servers []ProtonServer + Status int `json:"Status"` + + Location ProtonServerLocation `json:"Location"` + Servers []ProtonServer `json:"Servers"` } // "Location": { @@ -1195,12 +1197,12 @@ func protonServersByCountry(logicals []ProtonLogicals) map[string][]ProtonServer } func protonServersPrebuilt() []ProtonLogicals { - var prebuilts ProtonServerResponse + var prebuilts []ProtonLogicals err := json.Unmarshal(prebuiltProtonServersJson, &prebuilts) if err != nil { log.E("proton: servers: %d unmarshal: %v", len(prebuiltProtonServersJson), err) } - return prebuilts.R + return prebuilts } // go.dev/play/p/9kapzPiG72r