Documentation
¶
Overview ¶
Package hostutil provides shared utilities for host URL handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLocalhost ¶
IsLocalhost returns true if host is localhost, a .localhost subdomain, 127.0.0.1, or [::1] (with optional port).
func Normalize ¶
Normalize converts a host string to a full URL. - Empty string returns empty - localhost/127.0.0.1 defaults to http:// - Other bare hostnames default to https:// - Full URLs are used as-is
func OpenBrowser ¶
OpenBrowser opens the specified URL in the default browser.
func RequireSecureURL ¶ added in v0.2.0
RequireSecureURL returns an error if the URL uses http:// for a non-localhost host. Localhost (127.0.0.1, ::1, *.localhost) is exempt for local development.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.