This directory collects several examples built on the Barracuda App Server Lua socket library. The examples cover plain sockets, UDP, NTP, WebSockets, blocking WebSocket services, cosocket-based services, and a simple Eliza chatbot.
www/index.lsp- Landing page for the example bundle.www/ntp.lspandwww/asyncntp.lsp- Synchronous and asynchronous NTP examples.www/udp.lsp- UDP example.www/wsecho.lsp- WebSocket echo example.www/Blocking-WS-Server/- Blocking WebSocket example pages.www/Cosocket-WS-Server/- Cosocket-based WebSocket example pages.www/eliza/andwww/.lua/eliza.lua- Browser UI and server-side logic for the Eliza example.www/.lua/WebProxy.luaandwww/.lua/WebServer.lua- Additional socket-related helper examples.www/.preload- Startup logic used by the bundle.
Start the examples with the Mako Server:
cd socket-examples
mako -l::wwwFor more detail on starting the Mako Server, see the command line video tutorial and the command line options documentation.
After the server starts, open http://localhost:portno.
The www app acts as a small example hub. Each LSP page or subdirectory exercises a different part of the BAS socket APIs, so you can inspect the server-side code in isolation without having to build a larger application around it first.
- Some examples are blocking by design and are best run on a thread-enabled server such as Mako.
- WebSocket examples require a browser or client that can establish WebSocket connections successfully to the server.