Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm learning http, and trying to use telnet to send my own http requests.

In the command prompt, I entered:

telnet google.com 80

Result: The screen is cleared and I see a blinking cursor. 1. Why don't I see any indication that I'm connected?

Now, trying to type an http command (get index.html...) I see the cursor moving to the right as I type, but I don't see the letters appear on the screen. Only blanks. 2. Why is that?

(Using windows7 64 bit)

share|improve this question

migrated from serverfault.com Nov 1 '12 at 20:03

This question came from our site for professional system and network administrators.

    
Whoever voted down this question, you are welcome to explain in the comments what you found wrong about it. –  gidireich Nov 1 '12 at 16:37

2 Answers 2

up vote 2 down vote accepted

HTTP is not based on the telnet protocol. There's actually a few things wrong with using telnet as a basis for "testing" a HTTP server. First, telnet sends some extra bytes immediately after establishing a TCP connection to setup the session parameters. Second, HTTP does not echo data sent by the remote peer. Third, good IPS devices can drop connections to the HTTP port when that initial session data is sent, or when protocol violations are encountered.

Using the telnet client to test a HTTP server is hack-ish at best. The client will display a blank-screen when the TCP session is established, and will only display what the server sends back. If you're clever, you might be able to retrieve a page on many servers... but I would consider it bad-practice. Read up on the HTTP protocol on how to format a GET request.

A basic http request is done as follows:

GET / HTTP/1.0
 

Note the extra line after the request. A complete request ends with a blank newline.

share|improve this answer
    
So, what application would you use to build and send your own http requests? (as means of learning the protocol) –  gidireich Nov 1 '12 at 16:35
    
I use putty personally. Make sure the connection type is set to RAW, and the Local echo is forced to "on". For more advanced stuff... I just crack it open in my web-browser and use the debugger-tools built into chrome. –  TheCompWiz Nov 1 '12 at 16:37
    
How is putty different from windows telnet in the regard that you mentioned? "telnet sends some extra bytes immediately after establishing a TCP connection to setup the session parameters" –  gidireich Nov 1 '12 at 16:42
    
Putty using a "raw" connection type just establishes a RAW TCP connection without the initial telnet garbage. –  TheCompWiz Nov 1 '12 at 16:46
    
Oh, I think I see. The "raw" mode. I wasn't actually aware that telnet is different from this RAW. –  gidireich Nov 1 '12 at 16:46

Why don't I see any indication that I'm connected?

Why would the server send extra unneeded data and use more bandwidth? However you are connected and you can test that.

Try entering HTTP/1.0 and press [enter]. You should get a response.
(One containing an error, but usually enough to test if the webserver is up and running.)

I see the cursor moving to the right as I type, but I don't see the letters appear on the screen. Only blanks.

This is due to windows telnet. It has local echo disabled by default.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.