Lua socket has support for HTTP: http://w3.impa.br/~diego/software/luasocket/http.html , and I'd like it to be added to Spring.
It's currently implemented in Lua (https://github.com/diegonehab/luasocket ... c/http.lua), so it shouldn't be that hard, although it seems these files haven't been added/migrated to the repo (https://github.com/spring/spring/tree/0 ... socket/src)
Imo the best way to do it is to simply include it in socket.http once Spring is initialized assuming lua sockets are enabled.
For now I'll probably use something like https://github.com/spring/spring/blob/0 ... et.lua#L95 to achieve HTTP for what I need, but real support should be added in the future.
LuaSocket HTTP module
Moderator: Moderators
Re: LuaSocket HTTP module
why no lua interface for curl?
https://github.com/Lua-cURL/Lua-cURLv3
this pulls in a c dependency, too, not sure if a lua-only implementation is better.
https://github.com/Lua-cURL/Lua-cURLv3
this pulls in a c dependency, too, not sure if a lua-only implementation is better.
Re: LuaSocket HTTP module
Not sure if it makes sense to use this if we already have Lua sockets that supports it (admittedly doing it via native Lua is probably slower).abma wrote:why no lua interface for curl?
https://github.com/Lua-cURL/Lua-cURLv3
this pulls in a c dependency, too, not sure if a lua-only implementation is better.
I think we should avoid extra engine dependencies when we can, and only consider adding it if there's a significant performance boost or additional features.
PS: I played a bit with writing an analytics API in Lua, and it's interesting how simple it is to write JSONRPC using mostly just luasockets. That said, it's still rather limited and I'd want *real* http support that covers all the corner cases. This is how some graphs look like: http://ec2-52-24-31-116.us-west-2.compu ... onaws.com/