module Async::HTTP::Protocol::HTTPS

A server that supports both HTTP1.0 and HTTP1.1 semantics by detecting the version of the request.

Constants

HANDLERS

Public Class Methods

client(peer) click to toggle source
# File lib/async/http/protocol/https.rb, line 71
def self.client(peer)
        protocol_for(peer).client(peer)
end
names() click to toggle source

Supported Application Layer Protocol Negotiation names:

# File lib/async/http/protocol/https.rb, line 80
def self.names
        HANDLERS.keys.compact
end
protocol_for(peer) click to toggle source
# File lib/async/http/protocol/https.rb, line 58
def self.protocol_for(peer)
        # alpn_protocol is only available if openssl v1.0.2+
        name = peer.alpn_protocol
        
        Console.logger.debug(self) {"Negotiating protocol #{name.inspect}..."}
        
        if protocol = HANDLERS[name]
                return protocol
        else
                raise ArgumentError, "Could not determine protocol for connection (#{name.inspect})."
        end
end
server(peer) click to toggle source
# File lib/async/http/protocol/https.rb, line 75
def self.server(peer)
        protocol_for(peer).server(peer)
end