NodeMCU-HTTP-Server icon indicating copy to clipboard operation
NodeMCU-HTTP-Server copied to clipboard

bugFix: httpServer,lua#line:200,getpeer -> getaddr

Open XuPengfei-1020 opened this issue 4 years ago • 2 comments

Bye the way, this is much better than demo which official site recommand. 👍

XuPengfei-1020 avatar Jun 24 '20 15:06 XuPengfei-1020

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.

wangzexi avatar Jun 24 '20 16:06 wangzexi

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.

XuPengfei-1020 avatar Jun 25 '20 00:06 XuPengfei-1020