Documentation
¶
Index ¶
Constants ¶
View Source
const ( MinBackoff time.Duration = 10 * time.Millisecond MaxBackoff time.Duration = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func Join ¶
func Join(ctx context.Context, l io.ReadWriteCloser, r io.ReadWriteCloser) error
func LocalAddrs ¶
Types ¶
type IPRestriction ¶ added in v0.4.0
type IPRestriction struct {
// contains filtered or unexported fields
}
func ParseIPRestriction ¶ added in v0.4.0
func ParseIPRestriction(allows []string, denys []string) (IPRestriction, error)
ParseIPRestriction parses a slice of allows/denys restrictions in CIDR format.
func (IPRestriction) Accept ¶ added in v0.4.0
func (r IPRestriction) Accept(ip netip.Addr) bool
Accept checks an ip address according to Allow and Deny rules.
If the ip matches any of the Deny rules, Accept returns false. If the ip matches any of the Allow rules (after checking all Deny rules), Accept returns true.
Finally, if the ip matches no Allow or Deny rules, Accept returns true only if no explicit Allow rules were defined.
func (IPRestriction) AcceptAddr ¶ added in v0.4.0
func (r IPRestriction) AcceptAddr(addr net.Addr) bool
Click to show internal directories.
Click to hide internal directories.