Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
XuPengfei-1020 opened this issue Jun 24, 2020 · 2 comments
Open

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

XuPengfei-1020 opened this issue Jun 24, 2020 · 2 comments

Comments

@XuPengfei-1020
Copy link

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

@wangzexi
Copy link
Owner

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.

@XuPengfei-1020
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants