What you could do is make a simple program "pipe" that forwards to the
given socket.

Then you could do something like.

cat test_stdin | pipe localhost 1234