The problem is you are doing HTTP/1.0, not HTTP/1.1, and very few web
servers today do 1.0.   Try this:

exec 3<> /dev/tcp/www.kfai.org/80; echo -e "GET / HTTP/1.1\nHost:
www.kfai.org\n\n">&3; while read -r r; do echo $r; done <&3

--
Jay Kline
jay at slushpupie.com


On Wed, Sep 23, 2015 at 8:16 PM, gregrwm <tclug1 at whitleymott.net> wrote:
> this is totally a headscratcher for me.  my browser fetches and displays the
> expected and reasonable pages for google.com, www.kfai.org, and
> yermande.org.  and the first command below seems to successfully fetch
> google.com's root page.  however the second and third commands below get
> surprising results from www.kfai.org and yermande.org.  any ideas what's
> happening?
>
>>$ exec 3<>  /dev/tcp/google.com/80;echo "GET /">&3;while read -r r;do echo
>> $r;done<&3|head -5
>>HTTP/1.0 200 OK
>>Date: Thu, 24 Sep 2015 00:17:43 GMT
>>Expires: -1
>>Cache-Control: private, max-age=0
>>Content-Type: text/html; charset=ISO-8859-1
>
>>$ exec 3<>/dev/tcp/www.kfai.org/80;echo "GET /">&3;while read -r r;do echo
>> $r;done<&3
>><html><body><h1>It works!</h1>
>><p>This is the default web page for this server.</p>
>><p>The web server software is running but no content has been added,
>> yet.</p>
>></body></html>
>
>>$ exec 3<>/dev/tcp/yermande.org/80;echo "GET /">&3;while read -r r;do echo
>> $r;done<&3
>><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>><html><head>
>><title>404 Not Found</title>
>></head><body>
>><h1>Not Found</h1>
>><p>The requested URL / was not found on this server.</p>
>><hr>
>><address>Apache Server at 127.0.0.1 Port 80</address>
>></body></html>
>
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>