module Async::HTTP::Protocol::HTTP11

def self.bidirectional?

@returns [Boolean] Whether the protocol supports bidirectional communication.
def self.bidirectional?
	true
end

def self.client(peer, **options)

@parameter options [Hash] Options to pass to the client instance.
@parameter peer [IO] The peer to communicate with.

Create a client for an outbound connection.
def self.client(peer, **options)
	stream = ::IO::Stream(peer)
	
	return HTTP1::Client.new(stream, VERSION, **options)
end

def self.names

@returns [Array] The names of the supported protocol.
def self.names
	["http/1.1"]
end

def self.server(peer, **options)

@parameter options [Hash] Options to pass to the server instance.
@parameter peer [IO] The peer to communicate with.

Create a server for an inbound connection.
def self.server(peer, **options)
	stream = ::IO::Stream(peer)
	
	return HTTP1::Server.new(stream, VERSION, **options)
end

def self.trailer?

@returns [Boolean] Whether the protocol supports trailers.
def self.trailer?
	true
end