Module: Async::HTTP::Protocol::HTTP1

Extended by:
Configurable
Defined in:
lib/async/http/protocol/http1.rb,
lib/async/http/protocol/http1/client.rb,
lib/async/http/protocol/http1/server.rb,
lib/async/http/protocol/http1/request.rb,
lib/async/http/protocol/http1/response.rb,
lib/async/http/protocol/http1/connection.rb,
lib/async/http/protocol/http1/finishable.rb

Overview

Provides HTTP/1.0 and HTTP/1.1 client and server implementations.

Defined Under Namespace

Classes: Client, Connection, Finishable, Request, Response, Server

Constant Summary collapse

VERSION =
"HTTP/1.1"

Class Method Summary collapse

Methods included from Configurable

new

Class Method Details

.bidirectional?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/async/http/protocol/http1.rb', line 24

def self.bidirectional?
	true
end

.client(peer, **options) ⇒ Object

Create a client for an outbound connection.



37
38
39
40
41
# File 'lib/async/http/protocol/http1.rb', line 37

def self.client(peer, **options)
	stream = ::IO::Stream(peer)
	
	return HTTP1::Client.new(stream, VERSION, **options)
end

.namesObject



54
55
56
# File 'lib/async/http/protocol/http1.rb', line 54

def self.names
	["http/1.1", "http/1.0"]
end

.server(peer, **options) ⇒ Object

Create a server for an inbound connection.



47
48
49
50
51
# File 'lib/async/http/protocol/http1.rb', line 47

def self.server(peer, **options)
	stream = ::IO::Stream(peer)
	
	return HTTP1::Server.new(stream, VERSION, **options)
end

.trailer?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/async/http/protocol/http1.rb', line 29

def self.trailer?
	true
end