Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
640 views
in Technique[技术] by (71.8m points)

tcp - How to send carriage return over telnet?

I am using Ubuntu telnet client. I am trying to send 2 lines over the telnet connection that I have made.

For example:

> telnet en.wikipedia.org 80
  GET /wiki/Main_Page http/1.1   <CR>                            // line 1
  Host: en.wikipedia.org         <CR>                            // line 2
  <CR>

where CR stands for carriage return. The problem is after typing line 1, press CR , that line will be sent over the telnet connection. I can not be able to send line 2 immediately after that.

Can somebody help?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can set the crlf option in telnet. You can do this by, during your telnet session, typing the escape character (^]), and then "toggle crlf". A perhaps cleaner way is to specify this before making the connection:

$ telnet
telnet> toggle crlf
Will send carriage returns as telnet <CR><LF>.
telnet> open mailhost smtp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...