CountryRule
open class CountryRule: Rule
The rule matches the session based on the geographical location of the corresponding IP address.
-
The ISO code of the country.
Declaration
Swift
open let countryCode: String -
The rule should match the session which matches the country or not.
Declaration
Swift
open let match: Bool -
Undocumented
Declaration
Swift
open class CountryRule: Rule -
Create a new
CountryRuleinstance.Declaration
Swift
public init(countryCode: String, match: Bool, adapterFactory: AdapterFactory)Parameters
countryCodeThe ISO code of the country.
matchThe rule should match the session which matches the country or not.
adapterFactoryThe factory which builds a corresponding adapter when needed.
-
Match DNS request to this rule.
Declaration
Swift
override open func matchDNS(_ session: DNSSession, type: DNSSessionMatchType) -> DNSSessionMatchResultParameters
sessionThe DNS session to match.
typeWhat kind of information is available.
Return Value
The result of match.
-
Match connect session to this rule.
Declaration
Swift
override open func match(_ session: ConnectSession) -> AdapterFactory?Parameters
sessionconnect session to match.
Return Value
The configured adapter if matched, return
nilif not matched.
View on GitHub
CountryRule Class Reference