如何获取HTTP标头信息 [英] How To Get HTTP Header Info

查看:73
本文介绍了如何获取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的讨论可能会让您感兴趣:
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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆