I would like to send some text to a port on my machine using
telnet in the Mac OS X Terminal.
telnet localhost 8080
Then I type some text. Is that text send automatically or do I have to do something to send the text?
Here's a simple Python server:
Save it as server.py, and run it
Then try to connect using the terminal
Then just type anything and press return
The server print the data in the console and send it back to you.
That way, you'll know what you have to do to send data via telnet.
The answer depends on what the remote end supports:
What the remote end does with the received input, depends on the remote end. Most server processes (HTTP, SMTP, POP, IMAP) tend to wait for end-of-line (EOL, newline) char before processing input. Some others may wait for end-of-file (EOF, ^D) before starting to process the input.
When you typing the text in
To test Telnet in Linemode, you can run the dummy server to be listening on the local port, e.g. by using
then in another terminal connect to your server by:
and check when the data is received.
For more information about