1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
on *:start: {
//window -e @WWW
/socklisten www 80
}
on *:socklisten:www:{
var %t = www. $+ $sock(www*,0)
/echo @WWW (WWW) Connection
sockaccept %t
; /.sockwrite -n %t HTTP/1.1 200 OK
; /.sockwrite -n %t Date: $gettok($fulldate,1,32) $+ , $gettok($fulldate,3,32) $gettok($fulldate,2,32) $gettok($fulldate,5,32) $gettok($fulldate,4,32) GMT
; /.sockwrite -n %t Server: Apache
; /.sockwrite -n %t Content-Type: text/html
.timer1www $+ %t 1 1 /sockclose %t
}
/.sockwrite -n $sockname <html><head><title>TEST</head>
/.sockwrite -n $sockname <body>tet<br>test2</body></html>
on *:sockread:www.*:{
sockread %www
var %x = %www
var %t = $sockname
unset %www
if (%x != $null) {
if ($g32(%x,1) == GET) {
/.sockwrite -n %t HTTP/1.1 200 OK
/.sockwrite -n %t Date: $gettok($fulldate,1,32) $+ , $gettok($fulldate,3,32) $gettok($fulldate,2,32) $gettok($fulldate,5,32) $gettok($fulldate,4,32) GMT
/.sockwrite -n %t Server: Server: Apache/2.2.3 (Debian) PHP/5.2.5-3 with Suhosin-Patch
/.sockwrite -n %t X-Powered-By: PHP/5.2.5-3
/.sockwrite -n %t Content-Type: text/html; charset=ISO-8859-2
var %o = $g32(%x,2)
if (%o == /) {
/.sockwrite -n $sockname <html><head>
/.sockwrite -n $sockname <title>TYTUL</title>
/.sockwrite -n $sockname </head><body>
/.sockwrite -n $sockname PLOP<br><b> XDD </b>
/.sockwrite -n $sockname </body></html>
/.sockclose $sockname
/halt
}
var %y = 1
while (%y <= $lines(%o)) {
/.sockwrite -n $sockname $read(%o,%y)
inc %x
}
}
/echo @WWW [ $+ $sockname $+ ] %x
}
}
alias g32 {
return $gettok($1,$2,32)
} |