Feat: WeVPN support (#591)
This commit is contained in:
24
internal/updater/providers/wevpn/hostname.go
Normal file
24
internal/updater/providers/wevpn/hostname.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package wevpn
|
||||
|
||||
import "strings"
|
||||
|
||||
func getHostnameFromCity(city string) (hostname string) {
|
||||
host := strings.ToLower(city)
|
||||
host = strings.ReplaceAll(host, ".", "")
|
||||
host = strings.ReplaceAll(host, " ", "")
|
||||
|
||||
specialCases := map[string]string{
|
||||
"washingtondc": "washington",
|
||||
"mexicocity": "mexico",
|
||||
"denizli": "bursa",
|
||||
"sibu": "kualalumpur",
|
||||
"kiev": "kyiv",
|
||||
"stpetersburg": "petersburg",
|
||||
}
|
||||
if specialHost, ok := specialCases[host]; ok {
|
||||
host = specialHost
|
||||
}
|
||||
|
||||
hostname = host + ".wevpn.com"
|
||||
return hostname
|
||||
}
|
||||
Reference in New Issue
Block a user