NodeMCU-HTTP-Server
NodeMCU-HTTP-Server copied to clipboard
bugFix: httpServer,lua#line:200,getpeer -> getaddr
Bye the way, this is much better than demo which official site recommand. 👍
which official site?
https://nodemcu.readthedocs.io/en/master/modules/net/#netsocketgetpeer
net.socket:getpeer() Retrieve port and ip of remote peer.
net.socket:getaddr() Retrieve local port and ip of socket.
Oh... It's my mistake, it should be 'getpeer', thx.
update:
local port, ip=skt:getpeer()
local req = {source = msg, path = '', ip = ip}
What I means is your httpServer implemetion is much better than the official site recommand.