How to telnet google using command prompt?

2019-04-07 10:00发布

问题:

This is what I tried

telnet www.google.com 80

Get   HTTP/1.1  Host:www.google.com 

This I what I receive back

HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Content-Length: 925
Date: Sat, 24 Nov 2012 19:37:42 GMT
Server: GFE/2.0

How do I make this work? I trying to use telnet to access www.google.com

回答1:

$ telnet www.google.com 80
Trying 173.194.38.82...
Connected to www.google.com.
Escape character is '^]'.
GET / HTTP/1.1

HTTP/1.1 302 Found
Location: http://www.google.co.jp/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
[.... skipped ....]


回答2:

After issuing the request:

GET / HTTP/1.1

you also need input an empty line to show that your request has ended, otherwise, nothing will be returned.

Reference: http://blog.nullspace.io/day-208.html



标签: telnet