LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 01-01-2011, 11:31 PM   #1
kumpaka
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Rep: Reputation: 0
Connection closed by foreign host


Hi there,

Im trying to connect to the wikipedia and this is what i get,

telnet en.wikipedia.org 80
Trying 91.198.174.232...
Connected to text.esams.wikimedia.org.
Escape character is '^]'.
GET /wiki/Main_Page HTTP/1.1
Connection closed by foreign host.

Suddenly the connection gets dropped i have no idea what im doing wrong any help is appreciated.
 
Old 01-02-2011, 09:39 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Why?

You specify HTTP/1.1 but then do not follow the protocol. Either do:
Code:
GET /wiki/Main_Page HTTP/1.0
or
Code:
GET /wiki/Main_Page HTTP/1.1
Host: en.wikipedia.org
(include those newlines exactly!)

If you want to do raw HTTP over telnet like that, then you'll need to follow the protocol more closely if you want it to work.
 
Old 01-02-2011, 11:02 AM   #3
kumpaka
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AlucardZero View Post
Why?

You specify HTTP/1.1 but then do not follow the protocol. Either do:
Code:
GET /wiki/Main_Page HTTP/1.0
or
Code:
GET /wiki/Main_Page HTTP/1.1
Host: en.wikipedia.org
(include those newlines exactly!)

If you want to do raw HTTP over telnet like that, then you'll need to follow the protocol more closely if you want it to work.
Thanks for your reply, the problem is i dont have enough time to write that "Host: en.wikipedia.org", the connection gets closed on me and i already tried 1.0 only to have it closed on me aswell =(
 
Old 01-02-2011, 02:09 PM   #4
kumpaka
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Sorry, you were right i only had to type it fast and that last newline i was missing it =( got it solved thanks a lot.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Telnet "Connection closed by foreign host" jhilton Linux - Networking 37 03-29-2016 04:33 AM
telnet - connection closed by foreign host rbumann Linux - General 11 01-05-2012 08:43 AM
ssh_exchange_identification: Connection closed by remote host marafa Linux - Server 8 09-30-2008 05:06 AM
Telnet error "Connection closed by foreign host" without prompting login. jhilton Linux - Newbie 1 06-25-2008 06:36 PM
A network client can't ping a foreign host via a ppp connection Leandro Linux - Networking 1 11-15-2002 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 09:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration