如何获取HTTP标头信息 [英] How To Get HTTP Header Info
本文介绍了如何获取HTTP标头信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在C ++中获取此信息.我正在使用嗅探器,并且正在获取TCP标头信息,但我需要对此进行处理.任何帮助表示赞赏.谢谢.
How do I get this info in C++. I''m using a sniffer and I''m getting the TCP header info but I need to get this a s well. Any help appreciated. Thanks.
HTTP/1.1 200 OK
Date: Wed, 05 Nov 2003 10:46:04 GMT
Server: Apache/1.3.28 (Unix) PHP/4.2.3
Content-Location: CSS2-REC.en.html
Vary: negotiate,accept-language,accept-charset
TCN: choice
P3P: policyref=http://www.w3.org/2001/05/P3P/p3p.xml
Cache-Control: max-age=21600
Expires: Wed, 05 Nov 2003 16:46:04 GMT
Last-Modified: Tue, 12 May 1998 22:18:49 GMT
ETag: "3558cac9;36f99e2b"
Accept-Ranges: bytes
Content-Length: 10734
Connection: close
Content-Type: text/html; charset=iso-8859-1
Content-Language: en
推荐答案
关于StackOverflow的讨论可能会让您感兴趣: ^ ].
我不确定您要做什么,但是在TCP数据包级别阅读HTT协议应该很有趣(尽管只有在受虐狂的情况下).我怀疑您要在遇到某些标头值时触发一些操作.为了确保我们了解您要实现的目标,最好向您解释目标.
如果您可以控制网络体系结构,则可以使用代理.我是肯定的,这不是不是某种入侵尝试?
干杯!
—MRB
There was a discussion on StackOverflow that might interest you: http://stackoverflow.com/questions/2257172/http-header-in-a-packets[^].
I''m not sure what you are up to, but reading the HTT protocol on TCP packet level should prove to be quite entertaining ( though only if you are a masochist ). I suspect you want to trigger some action when certain header values are encountered. To make sure we understand what you are trying to achieve it would be best to explain your goals.
Using proxies could be an alternative if you have any control over the network architecture. I''m affirmative this is not some kind of intrusion attempt?
Cheers!
—MRB
这篇关于如何获取HTTP标头信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文