http-2 0.11.0 → 1.0.0
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 +4 -4
- data/README.md +10 -9
- data/lib/http/2/base64.rb +45 -0
- data/lib/http/2/client.rb +19 -6
- data/lib/http/2/connection.rb +235 -163
- data/lib/http/2/emitter.rb +7 -5
- data/lib/http/2/error.rb +24 -1
- data/lib/http/2/extensions.rb +53 -0
- data/lib/http/2/flow_buffer.rb +91 -33
- data/lib/http/2/framer.rb +184 -157
- data/lib/http/2/header/compressor.rb +157 -0
- data/lib/http/2/header/decompressor.rb +144 -0
- data/lib/http/2/header/encoding_context.rb +337 -0
- data/lib/http/2/{huffman.rb → header/huffman.rb} +25 -19
- data/lib/http/2/{huffman_statemachine.rb → header/huffman_statemachine.rb} +2 -0
- data/lib/http/2/header.rb +35 -0
- data/lib/http/2/server.rb +47 -20
- data/lib/http/2/stream.rb +130 -61
- data/lib/http/2/version.rb +3 -1
- data/lib/http/2.rb +14 -13
- data/sig/client.rbs +9 -0
- data/sig/connection.rbs +93 -0
- data/sig/emitter.rbs +13 -0
- data/sig/error.rbs +35 -0
- data/sig/extensions.rbs +5 -0
- data/sig/flow_buffer.rbs +21 -0
- data/sig/frame_buffer.rbs +13 -0
- data/sig/framer.rbs +54 -0
- data/sig/header/compressor.rbs +27 -0
- data/sig/header/decompressor.rbs +22 -0
- data/sig/header/encoding_context.rbs +34 -0
- data/sig/header/huffman.rbs +9 -0
- data/sig/header.rbs +27 -0
- data/sig/next.rbs +101 -0
- data/sig/server.rbs +12 -0
- data/sig/stream.rbs +91 -0
- metadata +38 -79
- data/.autotest +0 -20
- data/.coveralls.yml +0 -1
- data/.gitignore +0 -20
- data/.gitmodules +0 -3
- data/.rspec +0 -5
- data/.rubocop.yml +0 -93
- data/.rubocop_todo.yml +0 -131
- data/.travis.yml +0 -17
- data/Gemfile +0 -16
- data/Guardfile +0 -18
- data/Guardfile.h2spec +0 -12
- data/LICENSE +0 -21
- data/Rakefile +0 -49
- data/example/Gemfile +0 -3
- data/example/README.md +0 -44
- data/example/client.rb +0 -122
- data/example/helper.rb +0 -19
- data/example/keys/server.crt +0 -20
- data/example/keys/server.key +0 -27
- data/example/server.rb +0 -139
- data/example/upgrade_client.rb +0 -153
- data/example/upgrade_server.rb +0 -203
- data/http-2.gemspec +0 -22
- data/lib/http/2/buffer.rb +0 -76
- data/lib/http/2/compressor.rb +0 -572
- data/lib/tasks/generate_huffman_table.rb +0 -166
- data/spec/buffer_spec.rb +0 -28
- data/spec/client_spec.rb +0 -188
- data/spec/compressor_spec.rb +0 -666
- data/spec/connection_spec.rb +0 -681
- data/spec/emitter_spec.rb +0 -54
- data/spec/framer_spec.rb +0 -487
- data/spec/h2spec/h2spec.darwin +0 -0
- data/spec/h2spec/output/non_secure.txt +0 -317
- data/spec/helper.rb +0 -147
- data/spec/hpack_test_spec.rb +0 -84
- data/spec/huffman_spec.rb +0 -68
- data/spec/server_spec.rb +0 -52
- data/spec/stream_spec.rb +0 -878
- data/spec/support/deep_dup.rb +0 -55
- data/spec/support/duplicable.rb +0 -98
metadata
CHANGED
@@ -1,95 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Tiago Cardoso
|
7
8
|
- Ilya Grigorik
|
8
9
|
- Kaoru Maeda
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: bundler
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
13
|
+
date: 2024-06-28 00:00:00.000000000 Z
|
14
|
+
dependencies: []
|
28
15
|
description: Pure-ruby HTTP 2.0 protocol implementation
|
29
16
|
email:
|
17
|
+
- cardoso_tiago@hotmail.com
|
30
18
|
- ilya@igvita.com
|
31
19
|
executables: []
|
32
20
|
extensions: []
|
33
21
|
extra_rdoc_files: []
|
34
22
|
files:
|
35
|
-
- ".autotest"
|
36
|
-
- ".coveralls.yml"
|
37
|
-
- ".gitignore"
|
38
|
-
- ".gitmodules"
|
39
|
-
- ".rspec"
|
40
|
-
- ".rubocop.yml"
|
41
|
-
- ".rubocop_todo.yml"
|
42
|
-
- ".travis.yml"
|
43
|
-
- Gemfile
|
44
|
-
- Guardfile
|
45
|
-
- Guardfile.h2spec
|
46
|
-
- LICENSE
|
47
23
|
- README.md
|
48
|
-
- Rakefile
|
49
|
-
- example/Gemfile
|
50
|
-
- example/README.md
|
51
|
-
- example/client.rb
|
52
|
-
- example/helper.rb
|
53
|
-
- example/keys/server.crt
|
54
|
-
- example/keys/server.key
|
55
|
-
- example/server.rb
|
56
|
-
- example/upgrade_client.rb
|
57
|
-
- example/upgrade_server.rb
|
58
|
-
- http-2.gemspec
|
59
24
|
- lib/http/2.rb
|
60
|
-
- lib/http/2/
|
25
|
+
- lib/http/2/base64.rb
|
61
26
|
- lib/http/2/client.rb
|
62
|
-
- lib/http/2/compressor.rb
|
63
27
|
- lib/http/2/connection.rb
|
64
28
|
- lib/http/2/emitter.rb
|
65
29
|
- lib/http/2/error.rb
|
30
|
+
- lib/http/2/extensions.rb
|
66
31
|
- lib/http/2/flow_buffer.rb
|
67
32
|
- lib/http/2/framer.rb
|
68
|
-
- lib/http/2/
|
69
|
-
- lib/http/2/
|
33
|
+
- lib/http/2/header.rb
|
34
|
+
- lib/http/2/header/compressor.rb
|
35
|
+
- lib/http/2/header/decompressor.rb
|
36
|
+
- lib/http/2/header/encoding_context.rb
|
37
|
+
- lib/http/2/header/huffman.rb
|
38
|
+
- lib/http/2/header/huffman_statemachine.rb
|
70
39
|
- lib/http/2/server.rb
|
71
40
|
- lib/http/2/stream.rb
|
72
41
|
- lib/http/2/version.rb
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
84
|
-
-
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
42
|
+
- sig/client.rbs
|
43
|
+
- sig/connection.rbs
|
44
|
+
- sig/emitter.rbs
|
45
|
+
- sig/error.rbs
|
46
|
+
- sig/extensions.rbs
|
47
|
+
- sig/flow_buffer.rbs
|
48
|
+
- sig/frame_buffer.rbs
|
49
|
+
- sig/framer.rbs
|
50
|
+
- sig/header.rbs
|
51
|
+
- sig/header/compressor.rbs
|
52
|
+
- sig/header/decompressor.rbs
|
53
|
+
- sig/header/encoding_context.rbs
|
54
|
+
- sig/header/huffman.rbs
|
55
|
+
- sig/next.rbs
|
56
|
+
- sig/server.rbs
|
57
|
+
- sig/stream.rbs
|
89
58
|
homepage: https://github.com/igrigorik/http-2
|
90
59
|
licenses:
|
91
60
|
- MIT
|
92
|
-
metadata:
|
61
|
+
metadata:
|
62
|
+
bug_tracker_uri: https://github.com/igrigorik/http-2/issues
|
63
|
+
changelog_uri: https://github.com/igrigorik/http-2/blob/main/CHANGELOG.md
|
64
|
+
source_code_uri: https://github.com/igrigorik/http-2
|
65
|
+
homepage_uri: https://github.com/igrigorik/http-2
|
66
|
+
rubygems_mfa_required: 'true'
|
93
67
|
post_install_message:
|
94
68
|
rdoc_options: []
|
95
69
|
require_paths:
|
@@ -98,30 +72,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
72
|
requirements:
|
99
73
|
- - ">="
|
100
74
|
- !ruby/object:Gem::Version
|
101
|
-
version: 2.
|
75
|
+
version: 2.7.0
|
102
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
77
|
requirements:
|
104
78
|
- - ">="
|
105
79
|
- !ruby/object:Gem::Version
|
106
80
|
version: '0'
|
107
81
|
requirements: []
|
108
|
-
rubygems_version: 3.
|
82
|
+
rubygems_version: 3.5.3
|
109
83
|
signing_key:
|
110
84
|
specification_version: 4
|
111
85
|
summary: Pure-ruby HTTP 2.0 protocol implementation
|
112
|
-
test_files:
|
113
|
-
- spec/buffer_spec.rb
|
114
|
-
- spec/client_spec.rb
|
115
|
-
- spec/compressor_spec.rb
|
116
|
-
- spec/connection_spec.rb
|
117
|
-
- spec/emitter_spec.rb
|
118
|
-
- spec/framer_spec.rb
|
119
|
-
- spec/h2spec/h2spec.darwin
|
120
|
-
- spec/h2spec/output/non_secure.txt
|
121
|
-
- spec/helper.rb
|
122
|
-
- spec/hpack_test_spec.rb
|
123
|
-
- spec/huffman_spec.rb
|
124
|
-
- spec/server_spec.rb
|
125
|
-
- spec/stream_spec.rb
|
126
|
-
- spec/support/deep_dup.rb
|
127
|
-
- spec/support/duplicable.rb
|
86
|
+
test_files: []
|
data/.autotest
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'autotest/growl'
|
2
|
-
|
3
|
-
Autotest.add_hook(:initialize) {|at|
|
4
|
-
at.add_exception %r{^\.git|\.yardoc}
|
5
|
-
at.add_exception %r{^./tmp}
|
6
|
-
at.add_exception %r{coverage}
|
7
|
-
|
8
|
-
at.clear_mappings
|
9
|
-
|
10
|
-
at.add_mapping(%r%^spec/.*_spec\.rb$%) { |filename, _|
|
11
|
-
filename
|
12
|
-
}
|
13
|
-
at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
|
14
|
-
["spec/#{m[1].split('/').last}_spec.rb"]
|
15
|
-
}
|
16
|
-
at.add_mapping(%r%^spec/(spec_helper|shared/.*)\.rb$%) {
|
17
|
-
files_matching %r%^spec/.*_spec\.rb$%
|
18
|
-
}
|
19
|
-
nil
|
20
|
-
}
|
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
service_name: travis-ci
|
data/.gitignore
DELETED
data/.gitmodules
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
2
|
-
|
3
|
-
AllCops:
|
4
|
-
TargetRubyVersion: 2.1
|
5
|
-
DisplayCopNames: true
|
6
|
-
Exclude:
|
7
|
-
- 'bin/**'
|
8
|
-
- 'vendor/**/*'
|
9
|
-
- '**/huffman_statemachine.rb'
|
10
|
-
|
11
|
-
Layout/IndentHeredoc:
|
12
|
-
Exclude:
|
13
|
-
- 'lib/tasks/generate_huffman_table.rb'
|
14
|
-
- 'example/*'
|
15
|
-
|
16
|
-
Metrics/LineLength:
|
17
|
-
Max: 120
|
18
|
-
|
19
|
-
Metrics/BlockLength:
|
20
|
-
Max: 700
|
21
|
-
|
22
|
-
Layout/EndAlignment:
|
23
|
-
EnforcedStyleAlignWith: variable
|
24
|
-
|
25
|
-
Layout/CaseIndentation:
|
26
|
-
EnforcedStyle: end
|
27
|
-
|
28
|
-
Layout/IndentHash:
|
29
|
-
EnforcedStyle: consistent
|
30
|
-
|
31
|
-
Style/TrailingCommaInArrayLiteral:
|
32
|
-
EnforcedStyleForMultiline: comma
|
33
|
-
|
34
|
-
Style/TrailingCommaInHashLiteral:
|
35
|
-
EnforcedStyleForMultiline: comma
|
36
|
-
|
37
|
-
Layout/SpaceAroundOperators:
|
38
|
-
Enabled: false
|
39
|
-
|
40
|
-
Layout/ExtraSpacing:
|
41
|
-
Enabled: false
|
42
|
-
|
43
|
-
Layout/EmptyLinesAroundExceptionHandlingKeywords:
|
44
|
-
Enabled: false
|
45
|
-
|
46
|
-
Naming/UncommunicativeMethodParamName:
|
47
|
-
Enabled: false
|
48
|
-
|
49
|
-
Style/SignalException:
|
50
|
-
Enabled: false
|
51
|
-
|
52
|
-
Style/FrozenStringLiteralComment:
|
53
|
-
Enabled: false
|
54
|
-
|
55
|
-
Style/ParallelAssignment:
|
56
|
-
Enabled: false
|
57
|
-
|
58
|
-
Style/ParenthesesAroundCondition:
|
59
|
-
Enabled: false
|
60
|
-
|
61
|
-
Style/IfInsideElse:
|
62
|
-
Enabled: false
|
63
|
-
|
64
|
-
Style/IfUnlessModifier:
|
65
|
-
Enabled: false
|
66
|
-
|
67
|
-
Style/MultilineIfModifier:
|
68
|
-
Enabled: false
|
69
|
-
|
70
|
-
Lint/EmptyWhen:
|
71
|
-
Enabled: false
|
72
|
-
|
73
|
-
Style/TrailingCommaInArguments:
|
74
|
-
Enabled: false
|
75
|
-
|
76
|
-
Style/TrailingUnderscoreVariable:
|
77
|
-
Enabled: false
|
78
|
-
|
79
|
-
Style/SymbolArray:
|
80
|
-
Enabled: false
|
81
|
-
|
82
|
-
Style/CommentedKeyword:
|
83
|
-
Enabled: false
|
84
|
-
|
85
|
-
Style/PercentLiteralDelimiters:
|
86
|
-
Enabled: false
|
87
|
-
|
88
|
-
Performance/TimesMap:
|
89
|
-
Enabled: false
|
90
|
-
|
91
|
-
Performance/RedundantBlockCall:
|
92
|
-
Enabled: false
|
93
|
-
|
data/.rubocop_todo.yml
DELETED
@@ -1,131 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2016-06-09 10:57:54 -0400 using RuboCop version 0.40.0.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 24
|
10
|
-
Metrics/AbcSize:
|
11
|
-
Max: 185
|
12
|
-
|
13
|
-
# Offense count: 16
|
14
|
-
Metrics/BlockNesting:
|
15
|
-
Max: 5
|
16
|
-
|
17
|
-
# Offense count: 5
|
18
|
-
# Configuration parameters: CountComments.
|
19
|
-
Metrics/ClassLength:
|
20
|
-
Max: 325
|
21
|
-
|
22
|
-
Metrics/ModuleLength:
|
23
|
-
Max: 120
|
24
|
-
|
25
|
-
# Offense count: 12
|
26
|
-
Metrics/CyclomaticComplexity:
|
27
|
-
Max: 60
|
28
|
-
|
29
|
-
# Offense count: 9
|
30
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
31
|
-
# URISchemes: http, https
|
32
|
-
Metrics/LineLength:
|
33
|
-
Max: 108
|
34
|
-
|
35
|
-
# Offense count: 29
|
36
|
-
# Configuration parameters: CountComments.
|
37
|
-
Metrics/MethodLength:
|
38
|
-
Max: 134
|
39
|
-
|
40
|
-
# Offense count: 1
|
41
|
-
# Configuration parameters: CountKeywordArgs.
|
42
|
-
Metrics/ParameterLists:
|
43
|
-
Max: 7
|
44
|
-
|
45
|
-
# Offense count: 10
|
46
|
-
Metrics/PerceivedComplexity:
|
47
|
-
Max: 46
|
48
|
-
|
49
|
-
# Offense count: 1
|
50
|
-
# Cop supports --auto-correct.
|
51
|
-
# Configuration parameters: MaxKeyValuePairs.
|
52
|
-
Performance/RedundantMerge:
|
53
|
-
Exclude:
|
54
|
-
- 'lib/http/2/server.rb'
|
55
|
-
|
56
|
-
# Offense count: 4
|
57
|
-
Style/Documentation:
|
58
|
-
Exclude:
|
59
|
-
- 'spec/**/*'
|
60
|
-
- 'test/**/*'
|
61
|
-
- 'example/helper.rb'
|
62
|
-
- 'example/upgrade_server.rb'
|
63
|
-
- 'lib/tasks/generate_huffman_table.rb'
|
64
|
-
|
65
|
-
# Offense count: 3
|
66
|
-
# Cop supports --auto-correct.
|
67
|
-
# Configuration parameters: EnforcedStyle.
|
68
|
-
# SupportedStyles: braces, no_braces, context_dependent
|
69
|
-
Style/BracesAroundHashParameters:
|
70
|
-
Exclude:
|
71
|
-
- 'spec/connection_spec.rb'
|
72
|
-
- 'spec/server_spec.rb'
|
73
|
-
|
74
|
-
# Offense count: 1
|
75
|
-
# Cop supports --auto-correct.
|
76
|
-
Style/EmptyCaseCondition:
|
77
|
-
Exclude:
|
78
|
-
- 'example/upgrade_server.rb'
|
79
|
-
|
80
|
-
# Offense count: 1
|
81
|
-
# Configuration parameters: MinBodyLength.
|
82
|
-
Style/GuardClause:
|
83
|
-
Exclude:
|
84
|
-
- 'lib/http/2/connection.rb'
|
85
|
-
|
86
|
-
# Offense count: 2
|
87
|
-
# Cop supports --auto-correct.
|
88
|
-
# Configuration parameters: SupportedStyles, IndentationWidth.
|
89
|
-
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
|
90
|
-
Layout/IndentArray:
|
91
|
-
EnforcedStyle: consistent
|
92
|
-
|
93
|
-
# Offense count: 1
|
94
|
-
# Cop supports --auto-correct.
|
95
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
96
|
-
# SupportedStyles: symmetrical, new_line, same_line
|
97
|
-
Layout/MultilineArrayBraceLayout:
|
98
|
-
Exclude:
|
99
|
-
- 'spec/compressor_spec.rb'
|
100
|
-
|
101
|
-
# Offense count: 16
|
102
|
-
# Cop supports --auto-correct.
|
103
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
104
|
-
# SupportedStyles: symmetrical, new_line, same_line
|
105
|
-
Layout/MultilineHashBraceLayout:
|
106
|
-
Exclude:
|
107
|
-
- 'spec/compressor_spec.rb'
|
108
|
-
|
109
|
-
# Offense count: 1
|
110
|
-
# Cop supports --auto-correct.
|
111
|
-
Style/MutableConstant:
|
112
|
-
Exclude:
|
113
|
-
- 'example/upgrade_server.rb'
|
114
|
-
|
115
|
-
# Offense count: 1
|
116
|
-
# Cop supports --auto-correct.
|
117
|
-
Style/RedundantSelf:
|
118
|
-
Exclude:
|
119
|
-
- 'lib/http/2/connection.rb'
|
120
|
-
|
121
|
-
# Offense count: 1
|
122
|
-
# Cop supports --auto-correct.
|
123
|
-
Style/UnneededInterpolation:
|
124
|
-
Exclude:
|
125
|
-
- 'spec/compressor_spec.rb'
|
126
|
-
|
127
|
-
# Offense count: 1
|
128
|
-
# Cop supports --auto-correct.
|
129
|
-
Style/ZeroLengthPredicate:
|
130
|
-
Exclude:
|
131
|
-
- 'lib/http/2/framer.rb'
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gem 'rake'
|
4
|
-
gem 'yard'
|
5
|
-
|
6
|
-
group :test do
|
7
|
-
gem 'autotest-standalone'
|
8
|
-
gem 'coveralls', require: false
|
9
|
-
gem 'pry'
|
10
|
-
gem 'pry-byebug', platform: :mri
|
11
|
-
gem 'rspec', '~> 3.4.0'
|
12
|
-
gem 'rspec-autotest'
|
13
|
-
gem 'rubocop', '0.57.2'
|
14
|
-
end
|
15
|
-
|
16
|
-
gemspec
|
data/Guardfile
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
guard :process, name: 'HTTP/2 Server', command: 'ruby example/server.rb', stop_signal: 'TERM' do
|
2
|
-
watch(%r{^example/(.+)\.rb$})
|
3
|
-
watch(%r{^lib/http/2/(.+)\.rb$})
|
4
|
-
|
5
|
-
watch('Gemfile.lock')
|
6
|
-
end
|
7
|
-
|
8
|
-
def h2spec
|
9
|
-
puts 'Starting H2 Spec'
|
10
|
-
sleep 0.7
|
11
|
-
system '~/go-workspace/bin/h2spec -p 8080 -o 1 -s 4.2'
|
12
|
-
puts "\n"
|
13
|
-
end
|
14
|
-
|
15
|
-
guard :shell, name: 'H2 Spec' do
|
16
|
-
watch(%r{^example/(.+)\.rb$}) { h2spec }
|
17
|
-
watch(%r{^lib/http/2/(.+)\.rb$}) { h2spec }
|
18
|
-
end
|
data/Guardfile.h2spec
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
def h2spec
|
2
|
-
puts "Starting H2 Spec"
|
3
|
-
sleep 0.7
|
4
|
-
system '~/go-workspace/bin/h2spec -p 8080 -o 1 -s 5.1'
|
5
|
-
puts "\n"
|
6
|
-
end
|
7
|
-
|
8
|
-
guard :shell, name:'H2 Spec' do
|
9
|
-
watch(%r{^example/(.+)\.rb$}) { h2spec }
|
10
|
-
watch(%r{^lib/http/2/(.+)\.rb$}) { h2spec }
|
11
|
-
end
|
12
|
-
|
data/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2013 Ilya Grigorik
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
data/Rakefile
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
require 'rubocop/rake_task'
|
4
|
-
require 'yard'
|
5
|
-
require 'open3'
|
6
|
-
require_relative 'lib/tasks/generate_huffman_table'
|
7
|
-
|
8
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
9
|
-
t.exclude_pattern = './spec/hpack_test_spec.rb'
|
10
|
-
end
|
11
|
-
|
12
|
-
RSpec::Core::RakeTask.new(:hpack) do |t|
|
13
|
-
t.pattern = './spec/hpack_test_spec.rb'
|
14
|
-
end
|
15
|
-
|
16
|
-
task :h2spec do
|
17
|
-
if /darwin/ !~ RUBY_PLATFORM
|
18
|
-
abort "h2spec rake task currently only works on OSX.
|
19
|
-
Download other binaries from https://github.com/summerwind/h2spec/releases"
|
20
|
-
end
|
21
|
-
|
22
|
-
system 'ruby example/server.rb -p 9000 &', out: File::NULL
|
23
|
-
sleep 1
|
24
|
-
|
25
|
-
output = ''
|
26
|
-
Open3.popen2e('spec/h2spec/h2spec.darwin -p 9000 -o 1') do |_i, oe, _t|
|
27
|
-
oe.each do |l|
|
28
|
-
l.gsub!(/\e\[(\d+)(;\d+)*m/, '')
|
29
|
-
|
30
|
-
output << l
|
31
|
-
if l =~ /passed.*failed/
|
32
|
-
puts "\n#{l}"
|
33
|
-
break # suppress post-summary failure output
|
34
|
-
else
|
35
|
-
print '.'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
File.write 'spec/h2spec/output/non_secure.txt', output
|
41
|
-
|
42
|
-
system 'kill `pgrep -f example/server.rb`'
|
43
|
-
end
|
44
|
-
|
45
|
-
RuboCop::RakeTask.new
|
46
|
-
YARD::Rake::YardocTask.new
|
47
|
-
|
48
|
-
task default: [:spec, :rubocop]
|
49
|
-
task all: [:default, :hpack]
|
data/example/Gemfile
DELETED
data/example/README.md
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
## Interop
|
2
|
-
|
3
|
-
First, a quick test to ensure that we can talk to ourselves:
|
4
|
-
|
5
|
-
```bash
|
6
|
-
# Direct connection
|
7
|
-
$> ruby server.rb
|
8
|
-
$> ruby client.rb http://localhost:8080/ # GET
|
9
|
-
$> ruby client.rb http://localhost:8080/ -d 'some data' # POST
|
10
|
-
|
11
|
-
# Server push
|
12
|
-
$> ruby server.rb --push
|
13
|
-
$> ruby client.rb http://localhost:8080/ # GET
|
14
|
-
|
15
|
-
# TLS + NPN negotiation
|
16
|
-
$> ruby server.rb --secure
|
17
|
-
$> ruby client.rb https://localhost:8080/ # GET
|
18
|
-
$> ...
|
19
|
-
```
|
20
|
-
|
21
|
-
### [nghttp2](https://github.com/tatsuhiro-t/nghttp2) (HTTP/2.0 C Library)
|
22
|
-
|
23
|
-
Public test server: http://106.186.112.116 (Upgrade + Direct)
|
24
|
-
|
25
|
-
```bash
|
26
|
-
# Direct request (http-2 > nghttp2)
|
27
|
-
$> ruby client.rb http://106.186.112.116/
|
28
|
-
|
29
|
-
# TLS + NPN request (http-2 > nghttp2)
|
30
|
-
$> ruby client.rb https://106.186.112.116/
|
31
|
-
|
32
|
-
# Direct request (nghttp2 > http-2)
|
33
|
-
$> ruby server.rb
|
34
|
-
$> nghttp -vnu http://localhost:8080 # Direct request to Ruby server
|
35
|
-
```
|
36
|
-
|
37
|
-
### Twitter (Java server)
|
38
|
-
|
39
|
-
```bash
|
40
|
-
# NPN + GET request (http-2 > twitter)
|
41
|
-
$> ruby client.rb https://twitter.com/
|
42
|
-
```
|
43
|
-
|
44
|
-
For a complete list of current implementations, see [http2 wiki](https://github.com/http2/http2-spec/wiki/Implementations).
|