Method: Protocol::HTTP2::Framer#read_connection_preface

Defined in:
lib/protocol/http2/framer.rb

#read_connection_prefaceObject

Read and validate the HTTP/2 connection preface from the stream.



79
80
81
82
83
84
85
86
87
# File 'lib/protocol/http2/framer.rb', line 79

def read_connection_preface
	string = @stream.read(CONNECTION_PREFACE.bytesize)
	
	unless string == CONNECTION_PREFACE
		raise HandshakeError, "Invalid connection preface: #{string.inspect}"
	end
	
	return string
end