Skip to content

Instantly share code, notes, and snippets.

@masakielastic
Last active October 18, 2024 23:34
Show Gist options
  • Save masakielastic/1bdfbb60589b634a2f4e8220da3f35c3 to your computer and use it in GitHub Desktop.
Save masakielastic/1bdfbb60589b634a2f4e8220da3f35c3 to your computer and use it in GitHub Desktop.
size_t h2frames_size(void) {
return 24 + 0xC + 9 + 0x00 + 9 + 0x3A + 9;
}
uint8_t *h2frames(void) {
return
// PRI
"PRI * HTTP/2.0\x0D\x0A\x0D\x0ASM\x0D\x0A\x0D\x0A"
// settings
"\x00\x00\x0C"
"\x04"
"\x00"
"\x00\x00\x00\x00"
"\x00\x02\x00\x00\x00\x00"
"\x00\x03\x00\x00\x00\x64"
// ack
"\x00\x00\x00"
"\x04"
"\x01"
"\x00\x00\x00\x00"
// headers
"\x00\x00\x3a"
"\x01"
"\x05"
"\x00\x00\x00\x01"
"\x00"
// 7:method
"\x07\x3a\x6d\x65\x74\x68\x6f\x64"
// 3GET
"\x03\x47\x45\x54"
"\x00"
// 5:path
"\x05\x3a\x70\x61\x74\x68"
// 1/
"\x01\x2f"
"\x00"
// 7:scheme
"\x07\x3a\x73\x63\x68\x65\x6d\x65"
// 4http
"\x04\x68\x74\x74\x70"
"\x00"
// 10:authority
"\x0a\x3a\x61\x75\x74\x68\x6f\x72\x69\x74\x79"
// 9localhost
"\x09\x6c\x6f\x63\x61\x6c\x68\x6f\x73\x74";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment