Joe*_*ane 2 perl http apache2 mod-perl mason
我在Ubuntu 10.10(x86)上使用mod_perl 2,mason和apache 2.2(来自apt的标准包).当我向服务器发送HTTP请求时,我得到以下内容:
$ nc localhost 80 < ~/Desktop/test.http
HTTP/1.1 200 OK
Date: Mon, 22 Nov 2010 00:32:02 GMT
Server: Apache/2.2.16 (Ubuntu)
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/html
38
<html><body>Current IP Address: 127.0.0.1</body></html>
0
Run Code Online (Sandbox Code Playgroud)
我对此有点好奇.这些数字(38和0)是什么意思?我查看了我的日志,但我没有看到任何有意义的内容,我似乎无法找出谷歌的最佳搜索短语(如果我遗漏了文档中明显的内容,我很抱歉).我从telnet获得相同的结果(但Firefox似乎没有抛出任何类型的错误).
这是我的请求的内容(在末尾省略空格):
GET /test.html HTTP/1.1
HOST: example.com
Run Code Online (Sandbox Code Playgroud)
和我的脚本(test.html):
% my $ip = $r->connection->remote_ip();
<html><body>Current IP Address: <% $ip %></body></html>
Run Code Online (Sandbox Code Playgroud)
提前致谢!