Public and local addresses
The public value represents the address through which this browser session reaches Internet services. A router, carrier-grade NAT system, proxy, or VPN can make it different from an address assigned directly to the device. A local value belongs to the device's nearby network context. These values answer different questions, so they should not be expected to match or remain constant.