h2 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +3 -6
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/README.md +14 -0
- data/exe/h2 +8 -0
- data/h2.gemspec +2 -2
- data/lib/h2/client/celluloid.rb +0 -2
- data/lib/h2/client/concurrent.rb +4 -4
- data/lib/h2/stream.rb +10 -5
- data/lib/h2/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '09291052e9be6853fdbc3a57b31516e8a61b6a3a8a3e11e0d46215d4ec14cf7c'
|
4
|
+
data.tar.gz: a18029d8019099fa7908163981f4a03da9adff28c0a6c0851626fd852846c211
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0252b16b333e1218f0869a876f4687cb0513b0efe82af6fcc7ceedc140fa97dd5a30d7a22ca32d3d9894ce20669b6a34fb17fc56661e1d6676b421f7ca24a97
|
7
|
+
data.tar.gz: de69b22e572d2498ad4cc085ec821fab75043119dcaa219fe4fba48b9c2d5aac9552534274b39629d209a5aa6859e29b9562f6e193e54c9db435f97a8ad2f65a
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
h2 changelog
|
2
2
|
============
|
3
3
|
|
4
|
+
### 0.4.1 16 jun 2017
|
5
|
+
|
6
|
+
* update .travis.yml for latest supported versions
|
7
|
+
* add CLI flags for threading model
|
8
|
+
* update for http-2-0.9.x (`:promise_headers`)
|
9
|
+
|
4
10
|
### 0.4.0 17 jun 2017
|
5
11
|
|
6
12
|
* downgrade required ruby version to 2.2
|
data/Gemfile
CHANGED
@@ -14,5 +14,5 @@ group :development, :test do
|
|
14
14
|
gem 'awesome_print'
|
15
15
|
gem 'guard-rake'
|
16
16
|
gem 'pry-byebug', platforms: [:mri]
|
17
|
-
gem 'reel', require: 'reel/h2', git: 'https://github.com/kenichi/reel', branch: '
|
17
|
+
gem 'reel', require: 'reel/h2', git: 'https://github.com/kenichi/reel', branch: 'h2'
|
18
18
|
end
|
data/README.md
CHANGED
@@ -75,6 +75,20 @@ For more info on using the CLI `h2` installed with this gem:
|
|
75
75
|
|
76
76
|
`$ h2 --help`
|
77
77
|
|
78
|
+
## TLS CA Certificates
|
79
|
+
|
80
|
+
If you're running on macOS and using Homebrew's openssl package, you may need to
|
81
|
+
specify the CA file in the TLS options:
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
client = H2::Client.new addr: 'example.com', port: 443, tls: { ca_file: '/usr/local/etc/openssl/cert.pem' }
|
85
|
+
```
|
86
|
+
|
87
|
+
or when using the CLI:
|
88
|
+
|
89
|
+
`$ h2 --cafile /usr/local/etc/openssl/cert.pem https://example.com/`
|
90
|
+
|
91
|
+
|
78
92
|
## Alternate Concurrency Models
|
79
93
|
|
80
94
|
Right now, h2 uses one new thread per connection. This is hardly ideal, so a
|
data/exe/h2
CHANGED
@@ -43,6 +43,14 @@ OptionParser.new do |o|
|
|
43
43
|
options[:tls][:ca_file] = ca
|
44
44
|
end
|
45
45
|
|
46
|
+
o.on '--celluloid', 'use celluloid actor pool' do
|
47
|
+
require 'h2/client/celluloid'
|
48
|
+
end
|
49
|
+
|
50
|
+
o.on '--concurrent', 'use concurrent-ruby thread pool' do
|
51
|
+
require 'h2/client/concurrent'
|
52
|
+
end
|
53
|
+
|
46
54
|
o.on '-d', '--data [DATA]', String, 'post body data' do |d|
|
47
55
|
options[:method] = :post if options[:method].nil?
|
48
56
|
options[:body] = d
|
data/h2.gemspec
CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.version = H2::VERSION
|
7
7
|
spec.authors = ["Kenichi Nakamura"]
|
8
8
|
spec.email = ["kenichi.nakamura@gmail.com"]
|
9
|
-
spec.summary = 'an http/2 client based on http-2
|
10
|
-
spec.description = 'a pure ruby http/2 client based on http-2
|
9
|
+
spec.summary = 'an http/2 client based on http-2'
|
10
|
+
spec.description = 'a pure ruby http/2 client based on http-2'
|
11
11
|
spec.homepage = 'https://github.com/kenichi/h2'
|
12
12
|
spec.license = 'MIT'
|
13
13
|
spec.bindir = 'exe'
|
data/lib/h2/client/celluloid.rb
CHANGED
data/lib/h2/client/concurrent.rb
CHANGED
@@ -7,10 +7,11 @@ module H2
|
|
7
7
|
|
8
8
|
module ClassMethods
|
9
9
|
def thread_pool
|
10
|
+
return @thread_pool if @thread_pool
|
10
11
|
procs = ::Concurrent.processor_count
|
11
|
-
@thread_pool
|
12
|
-
|
13
|
-
|
12
|
+
@thread_pool = ::Concurrent::ThreadPoolExecutor.new min_threads: 0,
|
13
|
+
max_threads: procs,
|
14
|
+
max_queue: procs * 5
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
@@ -31,4 +32,3 @@ module H2
|
|
31
32
|
prepend H2::Client::Concurrent
|
32
33
|
end
|
33
34
|
end
|
34
|
-
|
data/lib/h2/stream.rb
CHANGED
@@ -77,11 +77,9 @@ module H2
|
|
77
77
|
on :close
|
78
78
|
end
|
79
79
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
@headers.merge! h
|
84
|
-
end
|
80
|
+
ah = method :add_headers
|
81
|
+
@stream.on :promise_headers, &ah
|
82
|
+
@stream.on :headers, &ah
|
85
83
|
|
86
84
|
@stream.on(:data) do |d|
|
87
85
|
on :data, d
|
@@ -89,6 +87,13 @@ module H2
|
|
89
87
|
end
|
90
88
|
end
|
91
89
|
|
90
|
+
def add_headers h
|
91
|
+
h = Hash[h]
|
92
|
+
on :headers, h
|
93
|
+
@headers.merge! h
|
94
|
+
@headers
|
95
|
+
end
|
96
|
+
|
92
97
|
def to_h
|
93
98
|
{ headers: headers, body: body }
|
94
99
|
end
|
data/lib/h2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: h2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenichi Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-2
|
@@ -86,7 +86,7 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '5.0'
|
89
|
-
description: a pure ruby http/2 client based on http-2
|
89
|
+
description: a pure ruby http/2 client based on http-2
|
90
90
|
email:
|
91
91
|
- kenichi.nakamura@gmail.com
|
92
92
|
executables:
|
@@ -133,8 +133,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.6
|
136
|
+
rubygems_version: 2.7.6
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
|
-
summary: an http/2 client based on http-2
|
139
|
+
summary: an http/2 client based on http-2
|
140
140
|
test_files: []
|