开发者

How to get Client IP in Lua Sockets

开发者 https://www.devze.com 2023-03-22 10:43 出处:网络
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;

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号