CS 742
HyperText Transfer Protocol (HTTP)
1. Determine which port the HTTP Server is probably listening to:
$ grep http /etc/services
http 80/tcp http
2. Try to connect to port 80 using a telnet client:
$ telnet www.cs.twsu.edu 80
Trying...
Connected to www.cs.twsu.edu.
Escape character is '^]'.
3. Get the top-level index file:
GET /index.html
Department of Computer Science
Connection closed by foreign host.
4. Connnect and execute a cgi-bin to get the hello message:
$ telnet kirk.cs.twsu.edu 6555
Trying 156.26.10.239...
Connected to kirk.cs.twsu.edu.
Escape character is '^]'.
GET /cgi-bin/hello
Hello World!
The current time is Wed Dec 4 00:06:39 CST 2002
Connection closed by foreign host.
5. Make a long request:
GET / HTTP/1.1
Host: www.cs.twsu.edu
HTTP/1.1 200 OK
Date: Fri, 30 Aug 2002 15:58:48 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux
Last-Modified: Fri, 08 Mar 2002 15:31:09 GMT
ETag: "1fe3-19e-3c88d93d"
Accept-Ranges: bytes
Content-Length: 414
Content-Type: text/html
Computer Science Computing Facilities
Connection closed by foreign host.
6. Retrieve only the header:
% telnet www 80
Trying 156.26.10.43...
Connected to gladia.cs.twsu.edu.
Escape character is '^]'.
HEAD / HTTP/1.1
Host: www
HTTP/1.1 200 OK
Date: Fri, 30 Aug 2002 16:02:23 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux
Last-Modified: Fri, 08 Mar 2002 15:31:09 GMT
ETag: "1fe3-19e-3c88d93d"
Accept-Ranges: bytes
Content-Length: 414
Content-Type: text/html