protocol-http2 0.22.0 → 0.22.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d3ec4ba460a65fcf1aa11e9c3ce4d0f46fde1cb0e7fa9cc33667b9142eb3dc4
4
- data.tar.gz: 0afd95c0651daf938a1b6e472376d38274dc7df70fdd38e9f28cfe6c657bc81f
3
+ metadata.gz: b23c19aa916a6d23a22b7f49fddc73fa91dd86957222178866a1389f74b4a037
4
+ data.tar.gz: b957666cdcf46c542baaebce6ec86d29d449ee80de4b4c98ca0409956b14b909
5
5
  SHA512:
6
- metadata.gz: 205b7683de9faee706dead27493c76b247c0d06c489778f670e4c49f0ecde263ad8b3b7ac1f86312681f83aee8bfaf4f82390f5d43c6a2d79dabdbe3f7d06b6a
7
- data.tar.gz: c72cfe3041d0c4edc6e0510a8dc04f88dd547ebff1e96b9322f7ac35a64850fe516677a7e3df8b26258d7f089f10a2a4504211da8871678920ef65aa32b8a76b
6
+ metadata.gz: 2673eba3eafe1131725b5212beb8a3fc2c2cfd98c0b62753aecf6f1b8729f6c7e402a4d6b194ec4719e60d7489ec4c007b76e034c09573d972806aa6f9ac81ca
7
+ data.tar.gz: 2d8473793aced6539d345c58274dc48665aaa29160a08fdca034d839036ef201d0dd2e05c90c33d54564e157200151fc36469a9a5feb9f679884e5ebc323d6ac
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "frame"
7
7
  require_relative "padded"
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP2
8
- VERSION = "0.22.0"
8
+ VERSION = "0.22.1"
9
9
  end
10
10
  end
@@ -1,25 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2024-2025, by Samuel Williams.
5
5
 
6
6
  require "traces/provider"
7
7
  require_relative "../../../../protocol/http2/framer"
8
8
 
9
9
  Traces::Provider(Protocol::HTTP2::Framer) do
10
10
  def write_connection_preface
11
+ return super unless Traces.active?
12
+
11
13
  Traces.trace("protocol.http2.framer.write_connection_preface") do
12
14
  super
13
15
  end
14
16
  end
15
17
 
16
18
  def read_connection_preface
19
+ return super unless Traces.active?
20
+
17
21
  Traces.trace("protocol.http2.framer.read_connection_preface") do
18
22
  super
19
23
  end
20
24
  end
21
25
 
22
26
  def write_frame(frame)
27
+ return super unless Traces.active?
28
+
23
29
  attributes = {
24
30
  "frame.length" => frame.length,
25
31
  "frame.class" => frame.class.name,
@@ -34,6 +40,8 @@ Traces::Provider(Protocol::HTTP2::Framer) do
34
40
  end
35
41
 
36
42
  def read_frame(...)
43
+ return super unless Traces.active?
44
+
37
45
  Traces.trace("protocol.http2.framer.read_frame") do |span|
38
46
  super.tap do |frame|
39
47
  span["frame.length"] = frame.length
@@ -45,6 +53,8 @@ Traces::Provider(Protocol::HTTP2::Framer) do
45
53
  end
46
54
 
47
55
  def flush
56
+ return super unless Traces.active?
57
+
48
58
  Traces.trace("protocol.http2.framer.flush") do
49
59
  super
50
60
  end
data/license.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2019-2024, by Samuel Williams.
3
+ Copyright, 2019-2025, by Samuel Williams.
4
4
  Copyright, 2019, by Yuta Iwama.
5
5
  Copyright, 2020, by Olle Jonsson.
6
6
  Copyright, 2023, by Marco Concetto Rudilosso.
7
+ Copyright, 2024, by Adam Petro.
7
8
 
8
9
  Permission is hereby granted, free of charge, to any person obtaining a copy
9
10
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -4,88 +4,15 @@ Provides a low-level implementation of the HTTP/2 protocol.
4
4
 
5
5
  [![Development Status](https://github.com/socketry/protocol-http2/workflows/Test/badge.svg)](https://github.com/socketry/protocol-http2/actions?workflow=Test)
6
6
 
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ``` ruby
12
- gem 'protocol-http2'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install protocol-http2
22
-
23
7
  ## Usage
24
8
 
25
- Here is a basic HTTP/2 client:
9
+ Please see the [project documentation](https://socketry.github.io/protocol-http2/) for more details.
10
+
11
+ - [Getting Started](https://socketry.github.io/protocol-http2/guides/getting-started/index) - This guide explains how to use the `protocol-http2` gem to implement a basic HTTP/2 client.
26
12
 
27
- ``` ruby
28
- require 'async'
29
- require 'async/io/stream'
30
- require 'async/http/endpoint'
31
- require 'protocol/http2/client'
13
+ ## See Also
32
14
 
33
- Async do
34
- endpoint = Async::HTTP::Endpoint.parse("https://www.google.com/search?q=kittens")
35
-
36
- peer = endpoint.connect
37
-
38
- puts "Connected to #{peer.inspect}"
39
-
40
- # IO Buffering...
41
- stream = Async::IO::Stream.new(peer)
42
-
43
- framer = Protocol::HTTP2::Framer.new(stream)
44
- client = Protocol::HTTP2::Client.new(framer)
45
-
46
- puts "Sending connection preface..."
47
- client.send_connection_preface
48
-
49
- puts "Creating stream..."
50
- stream = client.create_stream
51
-
52
- headers = [
53
- [":scheme", endpoint.scheme],
54
- [":method", "GET"],
55
- [":authority", "www.google.com"],
56
- [":path", endpoint.path],
57
- ["accept", "*/*"],
58
- ]
59
-
60
- puts "Sending request on stream id=#{stream.id} state=#{stream.state}..."
61
- stream.send_headers(headers, Protocol::HTTP2::END_STREAM)
62
-
63
- puts "Waiting for response..."
64
- $count = 0
65
-
66
- def stream.process_headers(frame)
67
- headers = super
68
- puts "Got response headers: #{headers} (#{frame.end_stream?})"
69
- end
70
-
71
- def stream.receive_data(frame)
72
- data = super
73
-
74
- $count += data.scan(/kittens/).count
75
-
76
- puts "Got response data: #{data.bytesize}"
77
- end
78
-
79
- until stream.closed?
80
- frame = client.read_frame
81
- end
82
-
83
- puts "Got #{$count} kittens!"
84
-
85
- puts "Closing client..."
86
- client.close
87
- end
88
- ```
15
+ - [Async::HTTP](https://github.com/socketry/async-http) - A high-level HTTP client and server implementation.
89
16
 
90
17
  ## Contributing
91
18
 
data/releases.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Releases
2
2
 
3
- ## Unreleased
3
+ ## v0.22.0
4
4
 
5
5
  ### Added Priority Update Frame and Stream Priority
6
6
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Yuta Iwama
9
+ - Adam Petro
9
10
  - Marco Concetto Rudilosso
10
11
  - Olle Jonsson
11
- autorequire:
12
12
  bindir: bin
13
13
  cert_chain:
14
14
  - |
@@ -40,7 +40,7 @@ cert_chain:
40
40
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
41
41
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
42
42
  -----END CERTIFICATE-----
43
- date: 2024-12-01 00:00:00.000000000 Z
43
+ date: 2025-02-01 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: protocol-hpack
@@ -62,16 +62,14 @@ dependencies:
62
62
  requirements:
63
63
  - - "~>"
64
64
  - !ruby/object:Gem::Version
65
- version: '0.18'
65
+ version: '0.47'
66
66
  type: :runtime
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
69
69
  requirements:
70
70
  - - "~>"
71
71
  - !ruby/object:Gem::Version
72
- version: '0.18'
73
- description:
74
- email:
72
+ version: '0.47'
75
73
  executables: []
76
74
  extensions: []
77
75
  extra_rdoc_files: []
@@ -109,7 +107,6 @@ licenses:
109
107
  metadata:
110
108
  documentation_uri: https://socketry.github.io/protocol-http2/
111
109
  source_code_uri: https://github.com/socketry/protocol-http2.git
112
- post_install_message:
113
110
  rdoc_options: []
114
111
  require_paths:
115
112
  - lib
@@ -124,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
121
  - !ruby/object:Gem::Version
125
122
  version: '0'
126
123
  requirements: []
127
- rubygems_version: 3.5.22
128
- signing_key:
124
+ rubygems_version: 3.6.2
129
125
  specification_version: 4
130
126
  summary: A low level implementation of the HTTP/2 protocol.
131
127
  test_files: []
metadata.gz.sig CHANGED
Binary file