Example: Checking a webserver
- Open a DOS window.
- Type: telnet [host] [ports]
E.g.: telnet www.mobilefish.com 80 [Press Enter]
- To you see what you are doing, turn on localecho.
- Type: Ctrl+] (hold down the Ctrl key and press the right bracket)
You will see:
Microsoft Telnet-client
Escape-teken is 'CTRL+]'
Microsoft Telnet>
- Type: set localecho [Press Enter]
You will see:
Local echo is enabled
Microsoft Telnet>
- [Press Enter]
- A connection to the web server is established.
HTTP commands can now be entered to let the web server send information back.
To show both header and content:
- Type: GET /index.html HTTP/1.1 [Press Enter]
- Type: Host: www.mobilefish.com [Press Enter]
- [Press Enter]
- The HTTP header and content will be displayed:
HTTP/1.1 200 OK
Date: Mon, 06 Feb 2006 18:10:35 GMT
Server: Apache/2.0.49 (Win32) mod_ssl/2.0.49 OpenSSL/0.9.7d PHP/4.3.7
mod_perl/1.999.24-dev Perl/v5.8.4
Accept-Ranges: bytes
Vary: Accept-Encoding,User-Agent
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1
fb
<?xml version="1.0" encoding="iso-8859-1"?>
:
Note:
If you use HTTP/1.1 the content is broken up into smaller chunks.
If you use HTTP/1.0 the content is not broken up..
To show only the header:
- Type: HEAD /index.html HTTP/1.1 [Press Enter]
- Type: Host: www.mobilefish.com [Press Enter]
- [Press Enter]
- Only the HTTP header will be displayed:
HTTP/1.1 200 OK
Date: Mon, 06 Feb 2006 18:10:35 GMT
Server: Apache/2.0.49 (Win32) mod_ssl/2.0.49 OpenSSL/0.9.7d PHP/4.3.7
mod_perl/1.999.24-dev Perl/v5.8.4
Accept-Ranges: bytes
Vary: Accept-Encoding,User-Agent
Content-Type: text/html; charset=ISO-8859-1
To show the header and the request itself
- Type: TRACE /index.html HTTP/1.1 [Press Enter]
- Type: Host: www.mobilefish.com [Press Enter]
- [Press Enter]
- The HTTP header and the request will be displayed:
HTTP/1.1 200 OK
Date: Mon, 06 Feb 2006 18:10:35 GMT
Server: Apache/2.0.49 (Win32) mod_ssl/2.0.49 OpenSSL/0.9.7d PHP/4.3.7
mod_perl/1.999.24-dev Perl/v5.8.4
Transfer-Encoding: chunked
Content-Type: message/http
TRACE /index.html HTTP/1.1
Host: www.mobilefish.com
To check if HTTP compression is applied on the webserver:
- Type: GET /index.html HTTP/1.1 [Press Enter]
- Type: Host: www.mobilefish.com [Press Enter]
- Type: Accept-encoding: gzip,deflate [Press Enter]
- [Press Enter]
- Only the HTTP header will be displayed:
HTTP/1.1 200 OK
Date: Mon, 06 Feb 2006 18:48:28 GMT
Server: Apache/2.0.49 (Win32) mod_ssl/2.0.49 OpenSSL/0.9.7d PHP/4.3.7
mod_perl/1.999.24-dev Perl/v5.8.4
Accept-Ranges: bytes
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 6215
Content-Type: text/html; charset=ISO-8859-1
Y=ksAfiOT0E$s-Q/-+??O-=NU{+a?,
|