0

I have a system I inherited and am trying to find a replacement video encoder board. The board we are trying to use does not allow for changing the rtsp port. I am trying to use nginx port forwarding to broadcast the frames from the new video encoder on the original port the rest of the system is expecting to see.

I am trying to do something like this

stream{
    server {
        listen 192.168.0.127:8080;         #original port
        proxy_pass 192.168.0.127:8554;     #new video encoder port
    }
}

This system uses buildroot to create images, and I have nginx 1.15.7 loaded in my images. In the menuconfig I was able to find "stream proxy modules" is this what I need included to use this stream directive?

looking at the documentation for stream it mentions that in order to use the stream directive "--with-stream" must be included http://nginx.org/en/docs/stream/ngx_stream_core_module.html#stream when I try and use this I get an error message "unknown directive --with-stream" according to this thread https://serverfault.com/questions/858067/unknown-directive-stream-in-etc-nginx-nginx-conf86 I need to use a load module and provide the path to the object file of the module I need. I cant seem to find any object files in the images I'm building however.

Im a little confused because looking at this page http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html there is another module that doesn't seem to need to use the stream directive in order to preform the proxy pass?

Any tips on where to look next for something to get this running?

another option I was looking into was using socat, I loaded that into an image and was trying to start that using socat tcp4-listen but I couldnt figure out how to make that work.

pathare
  • 1
  • 1

1 Answers1

0

If it is just forwarding one TCP port to another, the following command should do the task:

socat -d -d TCP4-LISTEN:8080,reuseaddr,bind=192.168.0.127,fork TCP4:192.168.0.127:8554
dest-unreach
  • 186
  • 1
  • 9
  • I appreciate the suggestion, I was trying to play with this some this morning and its not working at the moment. I get the error Cannot assign requested address. I think mad that the ip address is already in use by the time I am trying to run the command. I will have to go down the rabbit hole some more and figure out how to configure buildroots startup. this is one reason why I was really trying to figure out the nginx route since the system is already configured to do nginx things I just need to modify the config file to make changes. – pathare Oct 05 '22 at 14:00