Get http2 fingerprint with php. In addition to obtaining fingerprints, the rest of the code depends on the project amphp/http-server 2.0, in particular h2 protocol parsing. 中文版本
composer install
//index.php
$cer_path = '/path/to/domain.com.cer';
$key_path = '/path/to/domain.com.key';
$PeerName = 'domain.com';
$listen_uri = '0.0.0.0:443';
run php index.php
, then open the link to your configured URL(https://domain.com/) in your browser
Replace the dependency Http2Parser.php and Http2Parser.php in amphp by Autoload->addClassMap . Here's what changed.
- Add the function headleH2PF and assign the fingerprint information to Client->h2fp.
- Modify functions handleConnectionWindowIncrement handleHeaders, handlePriority handleSettings, used to get the fingerprint information required
- Modify the function parsePriorityFrame
- $weight should be an unsigned 8 bit integer
- Modify the function parseHeaders
- $weight should be an unsigned 8 bit integer
- When handlePriority is called, weight is increased by 256 to distinguish between when it comes from parseHeaders or parsePriorityFrame