By default, libhttp2 library only handles HTTP/2 frames and does not
recognize first 24 bytes of client connection preface. This design
choice is done due to the fact that server may want to detect the
application protocol based on first few bytes on clear text
communication. But for simple servers which only speak HTTP/2, it
is easier for developers if libhttp2 library takes care of client
connection preface.
If this option is used with nonzero |val|, libhttp2 library checks
first 24 bytes client connection preface. If it is not a valid
one, Session.recv and Session.memRecv will
return error ErrorCode.BAD_PREFACE, which is fatal error.
By default, libhttp2 library only handles HTTP/2 frames and does not recognize first 24 bytes of client connection preface. This design choice is done due to the fact that server may want to detect the application protocol based on first few bytes on clear text communication. But for simple servers which only speak HTTP/2, it is easier for developers if libhttp2 library takes care of client connection preface.
If this option is used with nonzero |val|, libhttp2 library checks first 24 bytes client connection preface. If it is not a valid one, Session.recv and Session.memRecv will return error ErrorCode.BAD_PREFACE, which is fatal error.