The local-ip module does one thing: it returns the primary interface's
IPv4 address, getLocalIpv4() (string | null, null when unknown or
offline). Backed by the single plugin:local-ip|get command (a port of
tauri-plugin-local-ip). It overlaps with network's
getLocalIpv4() — local-ip is the one-to-one port of the upstream
single-purpose plugin, while network bundles the v4/v6/public trio; pick
whichever fits.
Permission: local-ip:allow-get, collected in the
local-ip:default set. No scope — the plugin is constructed with no
arguments. From examples/hello/src/main.ts:
From examples/hello/capabilities/main.json:
From examples/hello/frontend/src/main.ts (the anchor LOCAL_IP_OK is
its real run output; asserted deterministically with an IPv4-shape
regex):
It resolves null instead of throwing: offline or with no determinable
primary interface the caller gets null and should treat it as optional
info.
plugin:local-ip|* totals 1 command:
| Command | API |
|---|---|
get |
getLocalIpv4() |
Full list in the Commands Reference and the API symbol reference.
Applicable version: ztron 0.3.1