========================================== 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://www.faqs.org/rfcs/rfc2616.html My input is marked by "*" in the examples below. * $ nc -v www.microsoft.com http DNS fwd/rev mismatch: www.microsoft.com.nsatc.net != origin2.microsoft.com www.microsoft.com.nsatc.net [207.46.245.156] 80 (http) open * HEAD / HTTP/1.0 * HTTP/1.1 200 OK Connection: close Date: Wed, 16 Feb 2005 13:51:36 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Cache-Control: public, max-age=2135 Expires: Wed, 16 Feb 2005 14:27:12 GMT Last-Modified: Wed, 16 Feb 2005 11:40:32 GMT Content-Type: text/html Content-Length: 16570 You can also use "GET" instead of "HEAD" to fetch an entire raw web page. The server below requires the "Host" subcommand to choose the correct virtual web server on the shared machine that has multiple domains: * $ nc -v teaching.idallen.com http idallen.com [216.180.243.122] 80 (http) open * GET /net2003/05w/notes/README.txt HTTP/1.0 * Host: teaching.idallen.com * HTTP/1.1 200 OK Date: Wed, 16 Feb 2005 14:51:47 GMT Server: Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.10 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.6b Last-Modified: Tue, 04 Jan 2005 18:22:41 GMT ETag: "4cdbfc-1a7-41dadef1" 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.