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
106 def build_parser(*)
107   return super unless @origin.scheme == "http"
108 
109   super("http/1.1")
110 end
coalescable? (connection)
[show source]
   # File lib/httpx/plugins/h2c.rb
93 def coalescable?(connection)
94   return super unless @options.fallback_protocol == "h2c" && @origin.scheme == "http"
95 
96   @origin == connection.origin && connection.options.fallback_protocol == "h2c"
97 end
match? (uri, options)
[show source]
   # File lib/httpx/plugins/h2c.rb
87 def match?(uri, options)
88   return super unless uri.scheme == "http" && @options.fallback_protocol == "h2c"
89 
90   super && options.fallback_protocol == "h2c"
91 end
upgrade (request, response)
[show source]
    # File lib/httpx/plugins/h2c.rb
 99 def upgrade(request, response)
100   @parser.reset if @parser
101   @parser = H2CParser.new(@write_buffer, @options)
102   set_parser_callbacks(@parser)
103   @parser.upgrade(request, response)
104 end