Does anyone know exactly when and how to send the authentication information through a socket when connection to the htaccess protected directory on a webserver. I tried
on *:SOCKOPEN:sockname: {
if ($sockerr) { echo -a 4 error opening socket | return }
sockwrite -n $sockname GET /path/to/prot-dir HTTP/1.1
sockwrite -n $sockname User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
sockwrite -n $sockname host:
www.domain.com sockwrite -n $sockname Authentication: Basic $encode(username:password, m)
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
but that only returns the 401 page (when using the same username and password in my web browser, I get access). I also tried waiting for the socket to receive the text
WWW-Authenticate: Basic realm="blahblah"
and then sockwrite the authentication information, but that isn't working either.