Voder-Vocoder

The Log of Hal Canary

Navigation: Home | THE LOG | Log Archives | Resume | Contact Info | Public Key | SSL | Math Applets | Site Map | WP Backend | RSS2 | Atom

« just utterances | Linux F/OSS Gaming Roundup 2006 »

telnet to port 80

To check out http headers, you can use telnet, but I’ve found it easier to use nc (netcat):

H="en.wikipedia.org"
G="/"
echo -en "GET $G HTTP/1.1\r\nHost: $H\r\n\r\n" \
    | nc $H 80

Here’s a script:

#!/bin/sh
#DTPD#
if [ "$#" -ne 2 ] ;  then
  echo -e "useage:\n  $0 HOST RESOURCE"
  echo -e "for example:\n  $0 www.google.com /"
  exit 1
fi
echo -en "GET $2 HTTP/1.1\r\nHost: $1\r\n\r\n"
echo -en "GET $2 HTTP/1.1\r\nHost: $1\r\n\r\n" \
  | nc $1 80

Hal Canary | Computers & Code | 2006-11-30 08:56:31 EST
Permanent Link | No Comments

Comments are closed.

Copyright 1997-2007 by Hal Canary.
mailto: h3 at halcanary dot org
xmpp:halcanary@jabber.org
aim:halwcanary
http://halcanary.org