RuleManager
open class RuleManager
The class managing rules.
-
The current used
RuleManager, there is only one manager should be used at a time.Note
This should be set before any DNS or connect sessions.Declaration
Swift
open static var currentManager: RuleManager = RuleManager(fromRules: [], appendDirect: true) -
The rule list.
Declaration
Swift
var rules: [Rule] = [] -
Undocumented
Declaration
Swift
open class RuleManager -
Create a new
RuleManagerfrom the given rules.Declaration
Swift
public init(fromRules rules: [Rule], appendDirect: Bool = false)Parameters
rulesThe rules.
appendDirectWhether to append a
DirectRuleat the end of the list so any request does not match with any rule go directly. -
Match DNS request to all rules.
Declaration
Swift
func matchDNS(_ session: DNSSession, type: DNSSessionMatchType)Parameters
sessionThe DNS session to match.
typeWhat kind of information is available.
-
Match connect session to all rules.
Declaration
Swift
func match(_ session: ConnectSession) -> AdapterFactory!Parameters
sessionconnect session to match.
Return Value
The matched configured adapter.
View on GitHub
RuleManager Class Reference