Method: Async::HTTP::Protocol::HTTP1::Connection#initialize

Defined in:
lib/async/http/protocol/http1/connection.rb

#initialize(stream, version, **options) ⇒ Connection

Returns a new instance of Connection.



17
18
19
20
21
22
# File 'lib/async/http/protocol/http1/connection.rb', line 17

def initialize(stream, version, **options)
  super(stream, **options)
  
  # On the client side, we need to send the HTTP version with the initial request. On the server side, there are some scenarios (bad request) where we don't know the request version. In those cases, we use this value, which is either hard coded based on the protocol being used, OR could be negotiated during the connection setup (e.g. ALPN).
  @version = version
end