{"id":20836303,"url":"https://github.com/igrigorik/spdy","last_synced_at":"2025-10-12T04:34:51.884Z","repository":{"id":56896562,"uuid":"1575328","full_name":"igrigorik/spdy","owner":"igrigorik","description":"SPDY is a protocol designed to reduce latency of web pages","archived":false,"fork":false,"pushed_at":"2013-01-25T06:34:00.000Z","size":178,"stargazers_count":315,"open_issues_count":1,"forks_count":20,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-29T00:09:33.275Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igrigorik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-06T02:57:55.000Z","updated_at":"2025-01-01T13:19:10.000Z","dependencies_parsed_at":"2022-08-20T17:10:13.336Z","dependency_job_id":null,"html_url":"https://github.com/igrigorik/spdy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Fspdy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Fspdy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Fspdy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Fspdy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igrigorik","download_url":"https://codeload.github.com/igrigorik/spdy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271530,"owners_count":20911587,"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-18T00:29:28.150Z","updated_at":"2025-10-12T04:34:46.830Z","avatar_url":"https://github.com/igrigorik.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SPDY\n\nSPDY is an experimental protocol designed to reduce latency of web pages. The SPDY v2 draft is the foundation for the HTTP 2.0 initiative led by the HTTPbis working group. In lab tests, SPDY shows 64% reduction in page load times! For more details, check out the [official site](https://sites.google.com/a/chromium.org/dev/spdy).\n\nToday, SPDY support is available in Chrome, Firefox, and Opera on the client, and on Apache, Nginx, Jetty, node.js and others on the server. All of Google web services, when running over SSL, are available through SPDY! In other words, if you are using Google products over SSL, chances are, you are fetching the content from Google servers over SPDY, not HTTP.\n\n* [HTTPBis - HTTP 2.0 Charter](http://datatracker.ietf.org/wg/httpbis/charter/)\n* [Life beyond HTTP 1.1: Google's SPDY](http://www.igvita.com/2011/04/07/life-beyond-http-11-googles-spdy)\n\n## Protocol Parser\n\nSPDY specification (draft 2) defines its own framing and message exchange protocol which is layered on top of a raw TCP connection. This gem implements a basic, pure Ruby parser for the SPDY v2 protocol:\n\n```ruby\ns = SPDY::Parser.new\n\ns.on_headers_complete { |stream_id, headers| ... }\ns.on_body             { |stream_id, data| ... }\ns.on_message_complete { |stream_id| ... }\n\ns \u003c\u003c recieved_data\n```\n\nHowever, parsing the data is not enough, to do the full exchange you also have to respond to a SPDY client with appropriate 'control' and 'data' frames:\n\n```ruby\nsr = SPDY::Protocol::Control::SynReply.new\nheaders = {'Content-Type' =\u003e 'text/plain', 'status' =\u003e '200 OK', 'version' =\u003e 'HTTP/1.1'}\nsr.create(:stream_id =\u003e 1, :headers =\u003e headers)\nsend_data sr.to_binary_s\n\n# or, to send a data frame\n\nd = SPDY::Protocol::Data::Frame.new\nd.create(:stream_id =\u003e 1, :data =\u003e \"This is SPDY.\")\nsend_data d.to_binary_s\n```\n\nSee example eventmachine server in *examples/spdy_server.rb* for a minimal SPDY \"hello world\" server.\n\n### License\n\nMIT License - Copyright (c) 2011 Ilya Grigorik\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrigorik%2Fspdy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figrigorik%2Fspdy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrigorik%2Fspdy/lists"}