zig run client.zig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| final class QuicInitialPacketParser | |
| { | |
| private string $buffer = ''; | |
| private int $offset = 0; | |
| public function parse(string $packet): array |
target: tls://104.18.26.120:443 (SNI/peer_name=example.com)
alpn_protocols(configured): h2,http/1.1
ALPN (negotiated): h2
>>> sending client preface (24 bytes)
>>> sending SETTINGS (empty payload)
FRAME #0 len=18 type=0x04(SETTINGS) flags=0x00 sid=0
0000 00 03 00 00 00 64 00 04 00 01 00 00 00 05 00 ff .....d..........
target: tls://104.18.27.120:443 (SNI/peer_name=example.com)
alpn_protocols(configured): h2,http/1.1
ALPN (negotiated): h2
>>> sending client preface (24 bytes)
>>> sending SETTINGS (empty payload)
FRAME #0 len=18 type=0x04(SETTINGS) flags=0x00 sid=0
0000 00 03 00 00 00 64 00 04 00 01 00 00 00 05 00 ff .....d..........