Module: Async::HTTP::Protocol::HTTP2
- Defined in:
- lib/async/http/protocol/http2.rb,
lib/async/http/protocol/http2/client.rb,
lib/async/http/protocol/http2/server.rb,
lib/async/http/protocol/http2/stream.rb,
lib/async/http/protocol/http2/request.rb,
lib/async/http/protocol/http2/response.rb,
lib/async/http/protocol/http2/connection.rb
Defined Under Namespace
Modules: Connection, WithPush
Classes: Client, Request, Response, Server, Stream
Constant Summary
collapse
- VERSION =
"h2"
- CLIENT_SETTINGS =
{
::Protocol::HTTP2::Settings::ENABLE_PUSH => 0,
::Protocol::HTTP2::Settings::MAXIMUM_FRAME_SIZE => 0x100000,
::Protocol::HTTP2::Settings::INITIAL_WINDOW_SIZE => 0xF00000,
}
- SERVER_SETTINGS =
{
::Protocol::HTTP2::Settings::MAXIMUM_CONCURRENT_STREAMS => 128,
::Protocol::HTTP2::Settings::MAXIMUM_FRAME_SIZE => 0x100000,
::Protocol::HTTP2::Settings::INITIAL_WINDOW_SIZE => 0xF00000,
::Protocol::HTTP2::Settings::ENABLE_CONNECT_PROTOCOL => 1,
}
- HTTPS =
'https'.freeze
- SCHEME =
':scheme'.freeze
- METHOD =
':method'.freeze
- PATH =
':path'.freeze
- AUTHORITY =
':authority'.freeze
- STATUS =
':status'.freeze
- PROTOCOL =
':protocol'.freeze
- CONTENT_LENGTH =
'content-length'.freeze
- CONNECTION =
'connection'.freeze
- TRAILERS =
'trailers'.freeze
Class Method Summary
collapse
Class Method Details
.bidirectional? ⇒ Boolean
32
33
34
|
# File 'lib/async/http/protocol/http2.rb', line 32
def self.bidirectional?
true
end
|
.client(peer, settings = CLIENT_SETTINGS) ⇒ Object
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/async/http/protocol/http2.rb', line 50
def self.client(peer, settings = CLIENT_SETTINGS)
stream = IO::Stream.new(peer, sync: true, deferred: true)
client = Client.new(stream)
client.send_connection_preface(settings)
client.start_connection
return client
end
|
.names ⇒ Object
72
73
74
|
# File 'lib/async/http/protocol/http2.rb', line 72
def self.names
["h2"]
end
|
.server(peer, settings = SERVER_SETTINGS) ⇒ Object
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/async/http/protocol/http2.rb', line 61
def self.server(peer, settings = SERVER_SETTINGS)
stream = IO::Stream.new(peer, sync: true, deferred: true)
server = Server.new(stream)
server.read_connection_preface(settings)
server.start_connection
return server
end
|