lokikiller / gopacket

Automatically exported from code.google.com/p/gopacket
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

HTTP layer parser #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello, Greame! 

I tried to create http headers parser but can't find any support of http in 
gopacket :(

Do you have any plans about http?

I thought is so simple to add parser for http request because it fit in one 
packet:

22:37:13.663782 IP xx.xxx.xx.49296 > xx.xx.162.80: Flags [P.], seq 
657400533:657400931, ack 4094641111, win 4102, options [nop,nop,TS val 
770089273 ecr 2255323072], length 398
.M4....I....P'/"...C............
-..9.m..GET /wp-content/themes/sahifa/images/separate.png HTTP/1.1
Host: avtodailynews.ru
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) 
AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A405 Safari/600.1.4
Accept-Language: ru
Referer: http://avtodailynews.ru/top-10-luchshix-krossoverov-2014-goda
Accept-Encoding: gzip, deflate

Original issue reported on code.google.com by pavel.odintsov on 21 Oct 2014 at 6:37

GoogleCodeExporter commented 9 years ago
Hey, Pavel,

I haven't done anything HTTP-related because:
1) net/http already has HTTP encoding/decoding, see 
https://code.google.com/p/gopacket/source/browse/examples/httpassembly/main.go 
for an example
2) it's a stream-based protocol, so there's no guarantee either the request or 
response will be in one packet.  The request may span multiple packets, or 
there may be multiple requests in a single packet.  Same for responses.

I'm going to mark this as WontFix for now, but feel free to reopen with any 
further questions.

Original comment by gconnell@google.com on 21 Oct 2014 at 6:53