LUA Script - web socket communication

2019-03-05 11:00发布

问题:

I am working with between Linux-based machine and android app.

First of all, I need to open a server socket on the machine to communicate with the app.

I need to code with LUA Script, and I have no idea with it..

Could you please give me some exmaple to open a server socket and receive the message from android app?

thank you.

回答1:

If you are looking for websocket support in Lua, try lua-websockets.

For regular sockets, you can use luasocket; the introduction page includes an echo server example working over TCP; this SO answer includes a client example.