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 HTTP/1.0\r"
expect -glob " HTTP/1.?\r
"
delay
send -- "Referer: http://localhost/meine/letzte/seite.html\r"
expect -glob "\r
"
delay
send -- "User-Agent: mein expect script\r"
expect -glob "\r
"
delay
send -- "Date: heute\r"
expect -glob "\r
"
delay
send -- "From: me@home\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