net.ip readonly property



net.ip returns a string

, which is the local IPv4 address of the device.

Example

local net = require "net" local function GetLocalIP () return net.ip end print(GetLocalIP()) -- Public and local ip addresses are different. Should output "192.168.x.x", or "127.0.0.x" (if offline.)