{"id":21656979,"url":"https://github.com/cotag/http-parser","last_synced_at":"2025-05-07T13:01:36.130Z","repository":{"id":9826421,"uuid":"11812797","full_name":"cotag/http-parser","owner":"cotag","description":"A super fast http parser for ruby","archived":false,"fork":false,"pushed_at":"2021-01-11T09:00:39.000Z","size":41,"stargazers_count":19,"open_issues_count":8,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-17T10:31:49.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cotag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-01T09:19:57.000Z","updated_at":"2024-12-27T22:00:38.000Z","dependencies_parsed_at":"2022-08-13T20:20:56.681Z","dependency_job_id":null,"html_url":"https://github.com/cotag/http-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2Fhttp-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2Fhttp-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2Fhttp-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2Fhttp-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cotag","download_url":"https://codeload.github.com/cotag/http-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250366708,"owners_count":21418770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T09:18:34.559Z","updated_at":"2025-05-07T13:01:36.099Z","avatar_url":"https://github.com/cotag.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http-parser\n\nRuby FFI bindings to [http-parser](https://github.com/joyent/http-parser) [![Build Status](https://travis-ci.org/cotag/http-parser.png)](https://travis-ci.org/cotag/http-parser)\n\n## Install\n\n```shell\ngem install http-parser\n```\nThis gem will compile a local copy of http-parser\n\n\n## Usage\n\n```ruby\nrequire 'rubygems'\nrequire 'http-parser'\n\n#\n# Create a shared parser\n#\nparser = HttpParser::Parser.new do |parser|\n  parser.on_message_begin do |inst|\n    puts \"message begin\"\n  end\n\n  parser.on_message_complete do |inst|\n    puts \"message end\"\n  end\n\n  parser.on_url do |inst, data|\n    puts \"url: #{data}\"\n  end\n\n  parser.on_header_field do |inst, data|\n    puts \"field: #{data}\"\n  end\n\n  parser.on_header_value do |inst, data|\n    puts \"value: #{data}\"\n  end\nend\n\n#\n# Create state objects to track requests through the parser\n#\nrequest = HttpParser::Parser.new_instance do |inst|\n  inst.type = :request\nend\n\n#\n# Parse requests\n#\nparser.parse request, \"GET /foo HTTP/1.1\\r\\n\"\nsleep 3\nparser.parse request, \"Host: example.com\\r\\n\"\nsleep 3\nparser.parse request, \"\\r\\n\"\n\n#\n# Re-use the memory for another request\n#\nrequest.reset!\n```\n\n## Acknowledgements\n\n* https://github.com/joyent/http-parser#readme\n* https://github.com/postmodern/ffi-http-parser#readme\n* https://github.com/deepfryed/http-parser-lite#readme","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotag%2Fhttp-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcotag%2Fhttp-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotag%2Fhttp-parser/lists"}