netguard

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package netguard keeps courier's posts to URLs products hand it (Web Push endpoints, webhooks) off the installation's own network.

Index

Constants

This section is empty.

Variables

View Source
var ErrForbiddenAddress = errors.New("destination resolves to an internal address")

ErrForbiddenAddress: the destination's host resolved to an address inside a network — loopback, private, link-local, shared, unspecified or multicast. Checked on the address dialed, after DNS, so a name that resolves inside (or rebinds to it) is refused too.

Functions

func Allowed

func Allowed(host string, hosts []string) bool

Allowed reports whether host matches hosts: an exact name or *.suffix; never an IP address.

func Forbidden

func Forbidden(ip netip.Addr) bool

Forbidden reports whether courier refuses to post to ip.

func Transport

func Transport() *http.Transport

Transport dials only public addresses and goes direct — through a proxy the address courier dials is the proxy's, not the destination's.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL