Guest User

Untitled

a guest
Jan 21st, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. local request = ([[
  2. GET /documentation/apache/ HTTP/1.0
  3. Connection: Keep-Alive
  4. User-Agent: Mozilla/4.01 [en] (Win95; I)
  5. Host: hal.etc.com.au
  6. Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
  7. Accept-Language: en
  8. Accept-Charset: iso-8859-1,*,utf-8
  9.  
  10. ]]):gsub("\n","\r\n")
  11.  
  12.  
  13. local parser = http_parser.new("request", {
  14. on_message_begin = function () end,
  15. on_url = function (url) end,
  16. on_header_field = function (field) end,
  17. on_header_value = function (value) end,
  18. on_headers_complete = function (info) end,
  19. on_body = function (chunk) end,
  20. on_message_complete = function () end
  21. })
  22. --parser:reinitialize("request")
  23. local nparsed = parser:execute(request, 0, #request)
  24. print("executed " .. nparsed .. " bytes")
Add Comment
Please, Sign In to add comment