0

I am new to tcp. Suppose I have a command to run on terminal that prints output line by line. How do I forward that output to a localhost port so that I can read it with other apps written in Python. From this thread, I set up a listening terminal with:

nc -l 2003

using port 2003. Then I run my command like this :

mycommand | netcat localhost 2003

But nothing goes through.

If I test with

echo hello_world | netcat localhost 2003

I can receive the hello_world though. How do I create this transfer?

The command is a kafka-console-consumer.sh like this:

bin/kafka-console-consumer --topic <topic_name> --from-beginning --bootstrap-server <dns:port> | netcat localhost 2003
2

0

You must log in to answer this question.

Browse other questions tagged .