cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: using telnet in libcurl - C++ library?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 12 Nov 2001 09:05:36 +0100 (MET)

On Fri, 9 Nov 2001, James Brannan wrote:

> I dont see anything about it in the online C api manual. Only the
> commandline tool seems to mention it. Moreover, I havent seen any
> examples.

That's mainly because no one has written anything about it. You should be
able to use a telnet URL the same way you use any other URL curl supports.

Of course, TELNET differs from other protocols slightly in the way that it
isn't file or document oriented. Curl's telnet feature will connect to a
host, do the TELNET negotiations and read stdin to send to the host and send
the data received to the write callback.

Since the telnet parts are a bit unused, it is not as richly developed as
some of the other protocols.

> All I need is someone to give me a couple lines of how I would telnet to
> a box, give it username and password, cd to a directory, and then run a
> script, then quit.

Logging in automatically with telnet will unfortunately require you to parse
the remote reply and figure out yourself when you need to pass the password
to the server.

> Thanks, and if I am just looking in the wrong spot on the site, please
> point me out to it.

Don't expect the telnet support to be as mature as the FTP and HTTP support
is. It is there, but you'll probably find it a bit "rough".

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-11-12