WebSocket Lua Module
Este módulo para luajit (supongo que debe funcionar con lua vm...) permite conectar contra un servidor websocket , enviar y recibir información en tiempo real.
Esta lib esta basada en el proyecto easywebsocketclient (https://github.com/dhbaird/easywsclient) y tiene un funcionamiento minimo para conectar, desconectar, enviar un string, recibir un string y comprobar el estado de la conexión.
Todo lo necesario para usarlo lo podeis ver en test.lua, podeis usar test.bat para ejecutar el test y verlo funcionando contra el servidor echo de websocket.org, el cual simplemente responde el mensaje que envias.
Para la parte de servidor, hay muchas opciones, pero yo recomiendo solamente 2:
- Si tu servidor no necesita intercambiar información entre usuarios conectados y solo realiza operaciones en el servidor, lo mejor es utilizar websocketd (http://websocketd.com/) el cual te permite crear un servidor websocket a partir de cualquier script que use stdin y stdout, por ejemplo scripts lua.
-Si tu servidor intercambia informacion entre usuarios, como un chat, y dispone de funcionalidades mas complejas, recomiendo usar nodejs+ws, por ejemplo este proyecto (https://github.com/0x1d/nodejs-ws-chat) si mirais los issues publique uno para añadir interfaz http sobre el puerto websocket (https://github.com/0x1d/nodejs-ws-chat/issues/1).
Este es el ejemplo del testsuite:

WebSocket Lua Module
This luajit module (i suppuse it should work with standard vm too...) allows to connect, send and recieve data from a websocket server. it acts as websocket client.
This library is based on easywebsocketclient (https://github.com/dhbaird/easywsclient) it has minimal api to connect, disconnect, send strings, recieve strings, and check connection status.
All api is referenced on test.lua, you can use test.bat to execute a test script that connects to echo server on websocket.org, it just reply the messages you send.
For the server part theres lot of websocket servers but i highly recommend this:
- If your server dont need to share info between connected users, and it simply executes scripts on server, use websocketd (http://websocketd.com/) it allow to create a websocket server from any script in any language that supports stdin and stdout, like lua with io.read/write
-If your server share info between connected users, like a chat, and make more complex routines, use nodejs+ws, this chat project can be used to test (https://github.com/0x1d/nodejs-ws-chat) also websocket server can stream http static websites over http, see my issue on the repo to do it (https://github.com/0x1d/nodejs-ws-chat/issues/1).
Este módulo para luajit (supongo que debe funcionar con lua vm...) permite conectar contra un servidor websocket , enviar y recibir información en tiempo real.
Esta lib esta basada en el proyecto easywebsocketclient (https://github.com/dhbaird/easywsclient) y tiene un funcionamiento minimo para conectar, desconectar, enviar un string, recibir un string y comprobar el estado de la conexión.
Todo lo necesario para usarlo lo podeis ver en test.lua, podeis usar test.bat para ejecutar el test y verlo funcionando contra el servidor echo de websocket.org, el cual simplemente responde el mensaje que envias.
Para la parte de servidor, hay muchas opciones, pero yo recomiendo solamente 2:
- Si tu servidor no necesita intercambiar información entre usuarios conectados y solo realiza operaciones en el servidor, lo mejor es utilizar websocketd (http://websocketd.com/) el cual te permite crear un servidor websocket a partir de cualquier script que use stdin y stdout, por ejemplo scripts lua.
-Si tu servidor intercambia informacion entre usuarios, como un chat, y dispone de funcionalidades mas complejas, recomiendo usar nodejs+ws, por ejemplo este proyecto (https://github.com/0x1d/nodejs-ws-chat) si mirais los issues publique uno para añadir interfaz http sobre el puerto websocket (https://github.com/0x1d/nodejs-ws-chat/issues/1).
Este es el ejemplo del testsuite:

WebSocket Lua Module
This luajit module (i suppuse it should work with standard vm too...) allows to connect, send and recieve data from a websocket server. it acts as websocket client.
This library is based on easywebsocketclient (https://github.com/dhbaird/easywsclient) it has minimal api to connect, disconnect, send strings, recieve strings, and check connection status.
All api is referenced on test.lua, you can use test.bat to execute a test script that connects to echo server on websocket.org, it just reply the messages you send.
For the server part theres lot of websocket servers but i highly recommend this:
- If your server dont need to share info between connected users, and it simply executes scripts on server, use websocketd (http://websocketd.com/) it allow to create a websocket server from any script in any language that supports stdin and stdout, like lua with io.read/write
-If your server share info between connected users, like a chat, and make more complex routines, use nodejs+ws, this chat project can be used to test (https://github.com/0x1d/nodejs-ws-chat) also websocket server can stream http static websites over http, see my issue on the repo to do it (https://github.com/0x1d/nodejs-ws-chat/issues/1).