Hi, is it possible to open a local socket where data could be forwarded to?
Let me explain: netcat works in LISTEN, TUNNEL, or CONNECT mode, I'm in a situation where I need to convert a TCP stream (coming to my host through an ssh tunnel) into and UDP one. That stream has to be forwarded to a new socket, where external clients could connect to get the stream (it's RTSP). I've found no way to do so with netcat (it refuse to setup listenig socket if it do not exists). It's kind of "local tunnel" that perform a TCP-UDP conversion. If that feature is not available and makes sense to you, I'll be happy to try implementing it.
thank you
jacopo
Jacopo, what you're describing sounds to me like a multimedia proxy server. I think that would be way beyond the scope of a "Swiss Army knife" tool such as netcat.
Converting the TCP byte stream to a UDP packet stream is the least of the challenges. (Yes, netcat can do that, but it assumes the input is text and converts each '\n' delimited text line to a UDP packet; that wouldn't make sense for RTSP audio/video data.)
The much bigger problem is that RTSP is an HTTP-like request/response control protocol (not a data transport) through which an RTSP client issues commands (OPTIONS, DESCRIBE, SETUP, PLAY, PAUSE, RECORD, TEARDOWN). The client will disconnect if it doesn't receive a valid response to each command. So to do what you're suggesting, netcat would have to implement the server side of the RTSP protocol, which would make it an RTSP (media) server.
The Wikipedia RTSP article explains this in more detail.
-- Chris