Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a TCP server listening on a localhost's port so I need a software that can be used to establish a TCP connection to the server and then send binary data, not ASCII.

For example, I want to send a message that looks something like this (8 bytes written as hex):


Are there any such programs freely available?

share|improve this question
up vote 7 down vote accepted

netcat naturally - you can pipe the data to netcat from another programme or file. And here's a windows port

share|improve this answer
there's a netcat build for windows – LawrenceC Apr 4 '11 at 13:54
+1 for netcat.. – Apr 5 '11 at 3:20

The Python programming language interpreter in interactive mode can be used for this.

$ python
>>> import socket
>>> s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
>>> s.connect(("localhost", 22))                  # connect to address ("localhost", 22)
>>> s.send(b"\xff\x00\xfe\x12\x00\xff\x28\xca")   # send the data from your example
8                                                 # send() returns number of bytes written
>>> s.recv(10)                                    # receive 10 bytes

Some might prefer Ruby.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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