0

If I want to quickly connect to a socket as a client and type something I can use telnet.

Is there a version of telnet or a similar program that provides the server-side of this?

In other words, is there some sort of "telnetserver" program I can connect to with telnet and then have a text chat with myself?

CaptainCodeman
  • 207
  • 1
  • 7
  • 2
    Does this answer your question? [something like telnet, but "listen on", not "connect to"](https://serverfault.com/questions/326044/something-like-telnet-but-listen-on-not-connect-to) – Chris J Jun 06 '20 at 10:09
  • Thanks for that. I searched but didn't find it. No need for downvotes.. – CaptainCodeman Jun 06 '20 at 10:34

1 Answers1

3

Telnet provides a lot more than would be required for your simple use case: according to Telnet Protocol Specification (RFC 854):

The TELNET Protocol is built upon three main ideas: first, the concept of a "Network Virtual Terminal"; second, the principle of negotiated options; and third, a symmetric view of terminals and processes.

You don't need any of these, as you simply want to send and receive messages. Netcat can handle these simple TCP connections on both ends. Here, the -vvv is just for verbosity, to better understand what's happening.

  • Server

     $ nc -l 12765 -vvv
     Listening on [0.0.0.0] (family 2, port 12765)
     Connection from client.example.net 58724 received!
    
  • Client

     $ nc example.com 12765 -vvv
     example.com [192.0.2.1] 12765 (?) open
    

Now, whatever is typed into either one of these appears in the other, after hitting enter.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122