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 /cgi-bin/test.cgi?VAR1=123&VAR2=xyz HTTP/1.0\r"
expect -glob " HTTP/1.?\r
"
delay
send -- "\r"
expect -glob "\r
"
delay
expect -glob "
Connection closed by foreign host.\r\r
"
delay
expect "> "
send -- "exit\r"
expect eof