Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local request = ([[
- GET /documentation/apache/ HTTP/1.0
- Connection: Keep-Alive
- User-Agent: Mozilla/4.01 [en] (Win95; I)
- Host: hal.etc.com.au
- Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
- Accept-Language: en
- Accept-Charset: iso-8859-1,*,utf-8
- ]]):gsub("\n","\r\n")
- local parser = http_parser.new("request", {
- on_message_begin = function () end,
- on_url = function (url) end,
- on_header_field = function (field) end,
- on_header_value = function (value) end,
- on_headers_complete = function (info) end,
- on_body = function (chunk) end,
- on_message_complete = function () end
- })
- --parser:reinitialize("request")
- local nparsed = parser:execute(request, 0, #request)
- print("executed " .. nparsed .. " bytes")
Add Comment
Please, Sign In to add comment