简体   繁体   中英

Differentiating http and http2 packets

I'm working with packets one by one and need to be able to edit both http and http2 contents.

The question is: is there a way to distinguish the two on a single packet basis?

Edit: For some additional info, the point is to read and edit large pcap files, so i'm trying to work with as little memory as possible.

On a per-packet basis, no. A single TCP packet could represent any arbitrary part of the stream. You need to capture (at least) the first part of the stream to work out whether it's HTTP or HTTP/2 (or anything else).

You can use Chrome DevTool > Network > Protocol to see the protocol used in the file transference.

DevTool>网络>协议

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM