{"id":19316015,"url":"https://github.com/socketry/protocol-http1","last_synced_at":"2025-04-05T00:05:14.464Z","repository":{"id":50074384,"uuid":"185373753","full_name":"socketry/protocol-http1","owner":"socketry","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-20T23:43:13.000Z","size":356,"stargazers_count":6,"open_issues_count":4,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T23:03:31.239Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/socketry.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://github.com/socketry/community/#funding","github":"ioquatix"}},"created_at":"2019-05-07T09:53:10.000Z","updated_at":"2025-03-20T23:43:14.000Z","dependencies_parsed_at":"2023-02-16T04:16:15.013Z","dependency_job_id":"3b4b7d58-f352-4b4e-8ba7-8dbb86340f4e","html_url":"https://github.com/socketry/protocol-http1","commit_stats":{"total_commits":140,"total_committers":6,"mean_commits":"23.333333333333332","dds":"0.050000000000000044","last_synced_commit":"8d0bd1094606c60b49299dbd392b58a7d56957f5"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fprotocol-http1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fprotocol-http1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fprotocol-http1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fprotocol-http1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketry","download_url":"https://codeload.github.com/socketry/protocol-http1/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266562,"owners_count":20910836,"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-10T01:09:25.955Z","updated_at":"2025-04-05T00:05:14.446Z","avatar_url":"https://github.com/socketry.png","language":"Ruby","funding_links":["https://github.com/socketry/community/#funding","https://github.com/sponsors/ioquatix"],"categories":[],"sub_categories":[],"readme":"# Protocol::HTTP1\n\nProvides a low-level implementation of the HTTP/1 protocol.\n\n[![Development Status](https://github.com/socketry/protocol-http1/workflows/Test/badge.svg)](https://github.com/socketry/protocol-http1/actions?workflow=Test)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n``` ruby\ngem 'protocol-http1'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install protocol-http1\n\n## Usage\n\nHere is a basic HTTP/1.1 client:\n\n``` ruby\nrequire 'async'\nrequire 'async/io/stream'\nrequire 'async/http/endpoint'\nrequire 'protocol/http1/connection'\n\nAsync do\n\tendpoint = Async::HTTP::Endpoint.parse(\"https://www.google.com/search?q=kittens\", alpn_protocols: [\"http/1.1\"])\n\t\n\tpeer = endpoint.connect\n\t\n\tputs \"Connected to #{peer} #{peer.remote_address.inspect}\"\n\t\n\t# IO Buffering...\n\tstream = Async::IO::Stream.new(peer)\n\tclient = Protocol::HTTP1::Connection.new(stream)\n\t\n\tdef client.read_line\n\t\t@stream.read_until(Protocol::HTTP1::Connection::CRLF) or raise EOFError\n\tend\n\t\n\tputs \"Writing request...\"\n\tclient.write_request(\"www.google.com\", \"GET\", \"/search?q=kittens\", \"HTTP/1.1\", [[\"Accept\", \"*/*\"]])\n\tclient.write_body(nil)\n\t\n\tputs \"Reading response...\"\n\tresponse = client.read_response(\"GET\")\n\t\n\tputs \"Got response: #{response.inspect}\"\n\t\n\tputs \"Closing client...\"\n\tclient.close\nend\n```\n\n## Contributing\n\nWe welcome contributions to this project.\n\n1.  Fork it.\n2.  Create your feature branch (`git checkout -b my-new-feature`).\n3.  Commit your changes (`git commit -am 'Add some feature'`).\n4.  Push to the branch (`git push origin my-new-feature`).\n5.  Create new Pull Request.\n\n### Developer Certificate of Origin\n\nIn order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.\n\n### Community Guidelines\n\nThis project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketry%2Fprotocol-http1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketry%2Fprotocol-http1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketry%2Fprotocol-http1/lists"}