How lua-websockets clients and servers work
masterThe library provides WebSocket (RFC 6455) compliant implementations in different execution models:
Clients
- Synchronous: Standard blocking client.
- Coroutine-based: Uses
copasfor non-blocking coroutine management. - Asynchronous: Uses
lua-evfor event-driven asynchronous operations.
Servers
- Coroutine-based: Uses
copas. - Asynchronous: Uses
lua-ev.
Important Note: lua-websockets is not a full webserver framework. It handles the WebSocket protocol specifically. It is designed to work alongside existing webservers (like Orbit) by running on different ports or processes, as WebSockets are not restricted by the Same-Origin Policy.