<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>寂静的深海 &#187; Snoopy</title>
	<atom:link href="http://www.deepseath.com/?feed=rss2&#038;tag=snoopy" rel="self" type="application/rss+xml" />
	<link>http://www.deepseath.com</link>
	<description></description>
	<lastBuildDate>Mon, 29 Jan 2024 09:55:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHP的Snoopy.class.php</title>
		<link>http://www.deepseath.com/?p=884</link>
		<comments>http://www.deepseath.com/?p=884#comments</comments>
		<pubDate>Wed, 17 Aug 2011 08:01:11 +0000</pubDate>
		<dc:creator>Deepseath</dc:creator>
				<category><![CDATA[程序人生]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[HTTP协议]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snoopy]]></category>
		<category><![CDATA[代码]]></category>

		<guid isPermaLink="false">http://www.deepseath.com/?p=884</guid>
		<description><![CDATA[使用PHP读取HTTP页面基本使用Snoopy，使用简单方便易用。 最近在使用过程中发现一些问题，读取某些服务器的时候会发现获取不到页面内容。 留意Snoopy的Header请求头的时候发现，对于HOST请求是类似 HOST: hostname:port 看代码，只要端口存在，就使用该方式发送请求。 但观察浏览器请求时发现如果端口为80的时候，会省略掉端口号。 按这个方式改造一下Snoopy的代码，加入判断端口号，如果端口号为80的情况下，则直接使用 HOST: hostname 否则使用 HOST: hostname:port 这样改写代码后上面的问题就解决了。 问题的原因不太清楚，呵呵，对于HTTP协议始终就是模棱两可一知半解，实用至上主义，问题解决就不管了。 另外，还有一个问题就是，自官方下载到的Snoopy.class.php的编码问题，这个文件使用的是“阿拉伯语（Windows）”进行编码的，至少在这个编码下查看没有乱码。 为了方便日后改写代码，我是利用阿拉伯语（Windows）打开，然后Copy无乱码的代码另存为UTF-8编码，方便日后更改处理。]]></description>
		<wfw:commentRss>http://www.deepseath.com/?feed=rss2&#038;p=884</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
