[SunRescue] OT: name-based hosting and GET /

Scotty Logan rescue at sunhelp.org
Thu Jan 25 18:41:22 CST 2001


You need to use HTTP/1.0, so just send the following

  GET / HTTP/1.0
  Host: www.whatever.com
  [blank line]

With HTTP/1.0 you'll get some headers you probably don't want:

 HTTP/1.1 200 OK
 Date: Fri, 26 Jan 2001 00:35:49 GMT
 Server: Apache/1.3.6 (Unix)
 Connection: close
 Content-Type: text/html

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
    <head>
 ...

But you can filter them with awk.  Also, I'd recommend netcat rather
than telnet:

 % /bin/echo "GET / HTTP/1.0\nHost: www.whatever.com\n" |\
 > nc www.somewhere.com 80 |\
 > awk '/<html>/,/</html>/' > mycopy.html

Hope this helps,

  Scotty

--
Scotty Logan, ITSS
swl at stanford.edu

> -----Original Message-----
> From: rescue-admin at sunhelp.org [mailto:rescue-admin at sunhelp.org]On
> Behalf Of Tim Harrison
> Sent: Thursday, January 25, 2001 12:32
> To: rescue at sunhelp.org
> Subject: Re: [SunRescue] OT: name-based hosting and GET /
>
>
> David Murphy wrote:
>
> > IIRC you give an HTTP Host: foovirtual.com header in your request.
>
> Okay, understood.  But, how can I do that via telnet?  Is there a way?
>
> --
>
>
> Tim Harrison
> Network Engineer
> harrison at timharrison.com
> http://www.networklevel.com/
> _______________________________________________
> Rescue maillist  -  Rescue at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/rescue
>
>




More information about the rescue mailing list