Documentation
¶
Overview ¶
Package netutil provides helpers for enumerating local network addresses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SuggestedLAN ¶
SuggestedLAN returns the first private LAN IPv4 on an up, non-loopback interface.
Types ¶
type Host ¶
type Host struct {
Address string `json:"address"`
Label string `json:"label"`
Kind string `json:"kind"` // loopback, any, lan, link_local, other
Suggested bool `json:"suggested,omitempty"`
}
Host describes a bindable listen address with a human label.
type HostsResult ¶
type HostsResult struct {
Hosts []Host `json:"hosts"`
Suggested string `json:"suggested"` // best default listen host for mobile Wi‑Fi proxy
SuggestedLAN string `json:"suggestedLAN,omitempty"` // first private LAN IPv4, if any
}
HostsResult is returned by ListListenHosts.
func ListListenHosts ¶
func ListListenHosts() HostsResult
ListListenHosts returns loopback, all-interfaces, and interface IPs suitable for proxy/control bind pickers. Suggested is the best LAN IPv4 for device Wi‑Fi setup.
Click to show internal directories.
Click to hide internal directories.