Async::HTTPSourceAsyncHTTPProtocolHTTP1

module HTTP1

Nested

Definitions

def self.bidirectional?

Signature

returns Boolean

Whether the protocol supports bidirectional communication.

Implementation

def self.bidirectional?
	true
end

def self.trailer?

Signature

returns Boolean

Whether the protocol supports trailers.

Implementation

def self.trailer?
	true
end

def self.client(peer, **options)

Create a client for an outbound connection.

Signature

parameter peer IO

The peer to communicate with.

parameter options Hash

Options to pass to the client instance.

Implementation

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

def self.server(peer, **options)

Create a server for an inbound connection.

Signature

parameter peer IO

The peer to communicate with.

parameter options Hash

Options to pass to the server instance.

Implementation

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

def self.names

Signature

returns Array

The names of the supported protocol.

Implementation

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