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
RuleManager
from the given rules.Declaration
Swift
public init(fromRules rules: [Rule], appendDirect: Bool = false)
Parameters
rules
The rules.
appendDirect
Whether to append a
DirectRule
at 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
session
The DNS session to match.
type
What kind of information is available.
-
Match connect session to all rules.
Declaration
Swift
func match(_ session: ConnectSession) -> AdapterFactory!
Parameters
session
connect session to match.
Return Value
The matched configured adapter.