Rule

open class Rule: CustomStringConvertible

The rule defines what to do for DNS requests and connect sessions.

  • Declaration

    Swift

    open var description: String
  • Create a new rule.

    Declaration

    Swift

    public init()
  • Match DNS request to this rule.

    Declaration

    Swift

    open func matchDNS(_ session: DNSSession, type: DNSSessionMatchType) -> DNSSessionMatchResult

    Parameters

    session

    The DNS session to match.

    type

    What kind of information is available.

    Return Value

    The result of match.

  • Match connect session to this rule.

    Declaration

    Swift

    open func match(_ session: ConnectSession) -> AdapterFactory?

    Parameters

    session

    connect session to match.

    Return Value

    The configured adapter if matched, return nil if not matched.