summaryrefslogtreecommitdiff
path: root/pkg/vpn/bonafide
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-11-24 20:40:18 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-11-24 21:16:01 +0100
commita81bf938fe2b9409d1fa0175cc5f20635bb16127 (patch)
treebb5b86654b687d31fe880a8996674272cf1e4fa8 /pkg/vpn/bonafide
parenta234a8ef5bf8564221f615d0010a810e501905bb (diff)
[feat] enable udp only if really announced
Diffstat (limited to 'pkg/vpn/bonafide')
-rw-r--r--pkg/vpn/bonafide/eip_service.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/vpn/bonafide/eip_service.go b/pkg/vpn/bonafide/eip_service.go
index 28d0479..1b8dc01 100644
--- a/pkg/vpn/bonafide/eip_service.go
+++ b/pkg/vpn/bonafide/eip_service.go
@@ -76,6 +76,26 @@ func (b *Bonafide) setupAuthentication(i interface{}) {
}
}
+func (b *Bonafide) IsUDPAvailable() bool {
+ if b.eip == nil {
+ return false
+ }
+ for _, gw := range b.eip.Gateways {
+ for _, t := range gw.Capabilities.Transport {
+ if t.Type == "openvpn" {
+ for _, proto := range t.Protocols {
+ if proto == "udp" {
+ return true
+ }
+ }
+ }
+
+ }
+
+ }
+ return false
+}
+
func (b *Bonafide) fetchEipJSON() error {
eip3API := config.APIURL + "3/config/eip-service.json"
resp, err := b.client.Post(eip3API, "", nil)