Documentation
¶
Overview ¶
Package netguard builds HTTP clients that refuse to reach private networks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBlocked = errors.New("destination not allowed")
ErrBlocked is returned when a destination is refused by the policy.
Functions ¶
func PublicAddr ¶
PublicAddr reports whether addr is a globally routable unicast address.
Types ¶
type Options ¶
type Options struct {
AllowPrivate bool // allow loopback, private and link-local destinations
AllowHTTP bool // allow plain http:// URLs (development only)
InsecureTLS bool // skip TLS verification (development only)
Resolve map[string]string // "host:port" -> "ip:port" overrides (development only)
}
Options relaxes the guard. The zero value is the production policy.