========================================== sample HTTP session using the "nc" command ========================================== -Ian! D. Allen - idallen@idallen.ca The "nc" TCP/IP "Swiss Army Knife" program is a "pure" way to connect your keyboard with a remote TCP/IP daemon. It is similar to "telnet", except it doesn't try to auto-negotiate any line parameters first. It is useful for connecting directly to many text-based Internet protocols. One such protocol is the Hyper Text Transfer Protocol (HTTP) used to send and receive Web pages over the Internet. It is documented in RFC2616: http://tools.ietf.org/html/rfc2616 http://www.faqs.org/rfcs/rfc2616.html My input is marked by "*" in the examples below. Note the blank line used to signal the end of my input to the server. * $ nc -v www.microsoft.com http Warning: inverse host lookup failed for 207.46.18.30: Unknown host Warning: inverse host lookup failed for 207.46.19.30: Unknown host Warning: inverse host lookup failed for 207.46.19.60: Unknown host Warning: inverse host lookup failed for 207.46.20.30: Unknown host Warning: inverse host lookup failed for 207.46.20.60: Unknown host Warning: inverse host lookup failed for 207.46.198.60: Unknown host Warning: inverse host lookup failed for 207.46.199.60: Unknown host Warning: inverse host lookup failed for 207.46.225.60: Unknown host lb1.www.ms.akadns.net [207.46.18.30] 80 (http) open * HEAD / HTTP/1.0 * HTTP/1.1 200 OK Connection: close Date: Thu, 02 Feb 2006 08:29:31 GMT Server: Microsoft-IIS/6.0 P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI" X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 22874 You can also use "GET" instead of "HEAD" to fetch an entire raw web page. The server below requires the "Host" subcommand (typed after the "GET" command) to choose the correct virtual web server on the shared machine that has multiple domains: * $ nc -v teaching.idallen.com http DNS fwd/rev mismatch: idallen.com != server20.tchmachines.com idallen.com [216.180.243.122] 80 (http) open * GET /net2003/06w/notes/README.txt HTTP/1.0 * Host: teaching.idallen.com * HTTP/1.1 200 OK Date: Thu, 02 Feb 2006 08:33:32 GMT Server: Apache/1.3.34 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.6b Last-Modified: Sat, 10 Dec 2005 03:57:42 GMT ETag: "39298c-1a7-439a5236" Accept-Ranges: bytes Content-Length: 423 Connection: close Content-Type: text/plain ======================================== README - Index to this NET2003 directory ======================================== Ian! D. Allen - idallen@idallen.ca This directory contains a set of notes for BIT NET2003. File names of the form "week01notes.txt" are study notes and exercises for each week. Read these files to know what to do each week. File names of the form "exercise01.txt" are exercises to be completed.