set force_conservative 0 ;
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}
set delay 3
catch {set delay [expr int([lindex $argv 0])]}
proc delay {} {
global delay
sleep $delay
}
set timeout -1
spawn $env(SHELL)
match_max 100000
expect -glob "> "
send -- "telnet localhost 80\r"
expect -glob "Trying 127.0.0.1...\r\r
Connected to localhost.\r\r
Escape character is '^\]'.\r\r
"
delay
send -- "GET /~$env(LOGNAME)/index.html HTTP/1.0\r"
expect -glob " HTTP/1.?\r
"
delay
send -- "If-Modified-Since: [clock format [expr [clock seconds] - 10] -format {%a, %d %b %Y %H:%M:%S %Z} -gmt 1 ]\r"
expect -glob "\r
"
delay
send -- "\r"
expect -glob "\r
"
delay
expect -glob "
Connection closed by foreign host.\r\r
"
delay
expect "> "
send -- "exit\r"
expect eof