luvit 使用 http 获取公网地址

2017-04-28  本文已影响49人  自由快挂

获取公网地址

local http = require('http')

local req = http.get('https://api.ipify.org', function ( res )
    res:on('data', function (ip)
      p("ip", ip)
    end)
    res:on('end', function ()
      p('stream ended')
    end)
end)

上一篇 下一篇

猜你喜欢

热点阅读