Use lua-http-parser to parse requests
moteus opened this issue · 0 comments
moteus commented
I rewrite Request
class to use lua-http-parser library.
I do not make PR because it require library with this PR.
You can checkout http_parser branch in my fork.
Library itself has no external deps and insatlls on Windows/Linux without problem.
Currently I rewrite Request class.
- Handle timeouts. methods like
:method()
,:path()
,:receiveBody()
returns nil andtimeout
so it possible call them again. - After all data readed all methods returns
nil
andclosed
and do not read and data from socket.
So in theory it possible implement keep alive feature. - Support
Transfer-Encoding: chunked
body.
If there interest to add it to main repo please let me know. It original lua-http-parser will not updated it
will be possible create fork of it or even add it inside repo itself as external deps (not good idea though :) )
Update
To install can be used now
luarocks install pegasus http.parser --server=http://luarocks.org/manifests/moteus