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 Classes: Client, Request, Response, Server, Stream

Constant Summary collapse

DEFAULT_SETTINGS =
{
	::HTTP::Protocol::HTTP2::Settings::ENABLE_PUSH => 0,
	::HTTP::Protocol::HTTP2::Settings::MAXIMUM_CONCURRENT_STREAMS => 256
}
HTTPS =
'https'.freeze
SCHEME =
':scheme'.freeze
METHOD =
':method'.freeze
PATH =
':path'.freeze
AUTHORITY =
':authority'.freeze
REASON =
'reason'.freeze
STATUS =
':status'.freeze
VERSION =
'HTTP/2.0'.freeze

Class Method Summary collapse

Class Method Details

.client(stream, settings = DEFAULT_SETTINGS) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/async/http/protocol/http2.rb', line 33

def self.client(stream, settings = DEFAULT_SETTINGS)
	client = Client.new(stream)
	
	client.send_connection_preface(settings)
	client.start_connection
	
	return client
end

.server(stream, settings = DEFAULT_SETTINGS) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/async/http/protocol/http2.rb', line 42

def self.server(stream, settings = DEFAULT_SETTINGS)
	server = Server.new(stream)
	
	server.read_connection_preface(settings)
	server.start_connection
	
	return server
end