module HTTPX::Plugins::H2C::ConnectionMethods

  1. lib/httpx/plugins/h2c.rb

Methods

Public Instance

  1. build_parser
  2. coalescable?
  3. match?
  4. upgrade

Public Instance methods

build_parser (*)
[show source]
    # File lib/httpx/plugins/h2c.rb
103 def build_parser(*)
104   return super unless @origin.scheme == "http"
105 
106   super("http/1.1")
107 end
coalescable? (connection)
[show source]
   # File lib/httpx/plugins/h2c.rb
90 def coalescable?(connection)
91   return super unless @options.fallback_protocol == "h2c" && @origin.scheme == "http"
92 
93   @origin == connection.origin && connection.options.fallback_protocol == "h2c"
94 end
match? (uri, options)
[show source]
   # File lib/httpx/plugins/h2c.rb
84 def match?(uri, options)
85   return super unless uri.scheme == "http" && @options.fallback_protocol == "h2c"
86 
87   super && options.fallback_protocol == "h2c"
88 end
upgrade (request, response)
[show source]
    # File lib/httpx/plugins/h2c.rb
 96 def upgrade(request, response)
 97   @parser.reset if @parser
 98   @parser = H2CParser.new(@write_buffer, @options)
 99   set_parser_callbacks(@parser)
100   @parser.upgrade(request, response)
101 end