netutil

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package netutil provides common network utility functions used across the httpc library. It includes IP validation, localhost detection, and security-related network checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLocalhost

func IsLocalhost(hostname string) bool

IsLocalhost detects localhost variations including: - "localhost" - 127.0.0.1 - ::1 - 0.0.0.0 - :: - 127.x.x.x range

func IsPrivateOrReservedIP

func IsPrivateOrReservedIP(ip net.IP) bool

IsPrivateOrReservedIP checks if an IP address is private, reserved, or otherwise not suitable for public internet communication. This is used for SSRF (Server-Side Request Forgery) protection.

func ValidateIP

func ValidateIP(ip net.IP) error

ValidateIP checks if an IP is allowed for outbound requests. Returns an error if the IP is blocked by security policy.

Types

This section is empty.

Jump to

Keyboard shortcuts

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