class Puma::Client

def try_to_parse_proxy_protocol

Experimental RBS support (using type sampling data from the type_fusion project).

def try_to_parse_proxy_protocol: () -> true

This signature was generated using 1 sample from 1 application.

false if more data is needed.
If necessary, read the PROXY protocol from the buffer. Returns
def try_to_parse_proxy_protocol
  if @read_proxy
    if @expect_proxy_proto == :v1
      if @buffer.include? "\r\n"
        if md = PROXY_PROTOCOL_V1_REGEX.match(@buffer)
          if md[1]
            @peerip = md[1].split(" ")[0]
          end
          @buffer = md.post_match
        end
        # if the buffer has a \r\n but doesn't have a PROXY protocol
        # request, this is just HTTP from a non-PROXY client; move on
        @read_proxy = false
        return @buffer.size > 0
      else
        return false
      end
    end
  end
  true
end