Feature: Private Internet Access custom port
This commit is contained in:
@@ -62,6 +62,7 @@ type Reader interface {
|
||||
GetPortForwardingStatusFilepath() (filepath models.Filepath, err error)
|
||||
GetPIAEncryptionPreset() (preset string, err error)
|
||||
GetPIARegions() (regions []string, err error)
|
||||
GetPIAPort() (port uint16, err error)
|
||||
|
||||
// Mullvad getters
|
||||
GetMullvadCountries() (countries []string, err error)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user