. , Apache bash - . script:
#!/bin/sh
cat <<END
Content-Type: text/plain
END
for i in $(seq 1 10)
do
echo $i
sleep 1
done
-, Apache CGI netcat:
$ nc localhost 80
GET /cgi-bin/chunkit.cgi HTTP/1.1
Host: localhost
HTTP/1.1 200 OK
Date: Tue, 24 Aug 2010 23:26:24 GMT
Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.7l DAV/2
Transfer-Encoding: chunked
Content-Type: text/plain
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
8
2
9
3
10
0
, netcat , , .
, Apache, , , , Content-Length; Transfer-Encoding: chunked , script . , script:
chunk () {
printf '%x\r\n' "${#1}"
printf '%s\r\n' "$1"
}
chunk $'1\n'
chunk $'2\n'
, , . Mac OS X 10.5.8 . - Safari, Chrome Firefox 4 , 1000 ( 1024, , - , ). Firefox 3.6 .
, sniffing , . , , , . , ( , HTML ), .
HTML , HTML . , - . , <div> , , . <pre> , Webkit , close, , Firefox . ; , , .
, , . , !