How to get Client IP in Lua Sockets
I'm having trouble locating how I g开发者_开发技巧o about getting the ip address of each client as they connect to my server, using LuaSockets; Also: I apologise if this has been answered in another post, but I could find it; Link me if this is the case.
Cheers!
Use conn:getpeername()
, it returns host and port of the client.
getpeername should work.
精彩评论