Feature: Private Internet Access custom port

This commit is contained in:
Quentin McGaw
2021-01-31 01:27:13 +00:00
parent 8f4354936c
commit 3c7dc9b9ad
5 changed files with 66 additions and 18 deletions

View File

@@ -63,3 +63,10 @@ func (r *reader) GetPIAEncryptionPreset() (preset string, err error) {
func (r *reader) GetPIARegions() (regions []string, err error) {
return r.env.CSVInside("REGION", constants.PIAGeoChoices())
}
// GetPIAPort obtains the port to reach the PIA server on from the
// environment variable PORT.
func (r *reader) GetPIAPort() (port uint16, err error) {
n, err := r.env.IntRange("PORT", 0, 65535, libparams.Default("0"))
return uint16(n), err
}