Documentation
¶
Overview ¶
Package filtering contains primitives for implementing filtering.
Index ¶
Constants ¶
View Source
const ( // DNSActionProxy proxies the traffic to the upstream server. DNSActionProxy = DNSAction(iota) // DNSActionNXDOMAIN replies with NXDOMAIN. DNSActionNXDOMAIN // DNSActionRefused replies with Refused. DNSActionRefused // DNSActionLocalHost replies with `127.0.0.1` and `::1`. DNSActionLocalHost // DNSActionEmpty returns an empty reply. DNSActionEmpty // DNSActionTimeout never replies to the query. DNSActionTimeout )
View Source
const ( // TLSActionProxy proxies the traffic to the destination. TLSActionProxy = TLSAction(iota) // TLSActionReset resets the connection. TLSActionReset // TLSActionTimeout causes the connection to timeout. TLSActionTimeout // TLSActionEOF closes the connection. TLSActionEOF // TLSActionAlertInternalError sends an internal error // alert message to the TLS client. TLSActionAlertInternalError // TLSActionAlertUnrecognizedName tells the client that // it's handshaking with an unknown SNI. TLSActionAlertUnrecognizedName )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNSListener ¶
DNSListener is the interface returned by DNSProxy.Start
type DNSProxy ¶
type DNSProxy struct {
// OnQuery is the MANDATORY hook called whenever we
// receive a query for the given domain.
OnQuery func(domain string) DNSAction
// Upstream is the OPTIONAL upstream transport.
Upstream DNSTransport
// contains filtered or unexported fields
}
DNSProxy is a DNS proxy that routes traffic to an upstream resolver and may implement filtering policies.
type DNSTransport ¶
type DNSTransport interface {
RoundTrip(ctx context.Context, query []byte) ([]byte, error)
CloseIdleConnections()
}
DNSTransport is the type we expect from an upstream DNS transport.
type TLSProxy ¶
type TLSProxy struct {
// OnIncomingSNI is the MANDATORY hook called whenever we have
// successfully received a ClientHello message.
OnIncomingSNI func(sni string) TLSAction
}
TLSProxy is a TLS proxy that routes the traffic depending on the SNI value and may implement filtering policies.
Click to show internal directories.
Click to hide internal directories.