I have a server that listens to simple tcp sockets. If connecting to it, it prints a prompt and I can type commands, hit enter, see (and save) results, and then have the prompt again. I'm using telnet right now to connect, but want something more console/shell like.

Specifically, I'm looking for a tool that only sends what I've typed when I type (meaning, not every character I type), and so allows me to edit the line in the client side. In telnet, if i write type 'foo' (without quotes) and then hit backspace and type 'o', the server gets 'fooo', which it can't handle. I want the backspace to be handled in the client, so the server sees 'foo'. I also want history handling.

I work in Windows and looking for freeware

link|improve this question

67% accept rate
Download a tool called socket workbench. You get a 30 day trial which will allow you to do most of what you want. However it is worth while buying if you are doing this stuff alot J – James Feb 18 '10 at 16:13
feedback

4 Answers

up vote 3 down vote accepted

Did you have a look at netcat ( http://netcat.sourceforge.net/)

link|improve this answer
i don't think it does what i want and it is not for windows – IttayD Feb 18 '10 at 16:31
According to en.wikipedia.org/wiki/Netcat, there's a Windows version – Dominik Feb 18 '10 at 17:04
I know and have used netcat in the past. I don't think it fits the bill. From wikipedia: "Netcat is designed to be a dependable “back-end” device that can be used candidly or easily driven by other programs and scripts" – IttayD Feb 18 '10 at 19:21
@IttayD: netcat is a TCP client, and you asked for exactly that. Besides, the Windows versions of netcat use the read-line functionality built into Windows Console. So the program automatically gets command history support. (And even macros! If you mess with doskey for a minute.) – grawity Feb 18 '10 at 19:26
feedback

Try ncat, which comes with nmap 5.0 and later. I run:

C:\>"\Program Files (x86)\Nmap\ncat.exe" www.google.com 80

I type:

HEAD / HTTP/1.0
Host: www.google.com
<extra return>

I get:

HTTP/1.0 200 OK
Date: Thu, 18 Feb 2010 20:48:34 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=31b99fd75e6e122a:TM=1266526114:LM=1266526114:S=ncRwt4V-M8RC4E_Y; expires=Sat, 18-Feb-2012 20:48:34 GMT; path=/; domain=.google.com
Set-Cookie: NID=31=bCeSJHeBgJOQNsQS6tDwRBoEkDHpYuz0LjtF5kCP-AngavYRcJxb56LXzhDJNt8pSPXw-NhQkYhgVn-DC4Qk9pfRs1In-5ZBRH4NAczJabFU9P16_ROz9RnHVwOlB3sj; expires=Fri, 20-Aug-2010 20:48:34 GMT; path=/; domain=.google.com; HttpOnly
Server: gws
X-XSS-Protection: 0
link|improve this answer
feedback

I ended up using socat http://www.dest-unreach.org/socat/ (http://www.gentilkiwi.com/telechargements-s43-t-socat.htm#englishversion). together with cygwin's readline, I have all that I need.

Did not compare to netcat.

link|improve this answer
As I mentioned in my comment on Dominik's post, Windows already comes with "readline"-like functionality for all programs (unless they explicitly disable it, like telnet does). Cygwin is not required. – grawity Feb 18 '10 at 20:09
but readline is much more powerful, e.g. ctrl-r to search back in history. i've marked dominik's reply as an answer. – IttayD Feb 19 '10 at 9:29
Okay, Windows Console doesn't have search - but it has F7. – grawity Feb 20 '10 at 12:26
feedback

Meant to put this as an answer

Download a tool called socket workbench. You get a 30 day trial which will allow you to do most of what you want. However it is worth while buying if you are doing this stuff alot

J

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.