简体   繁体   中英

using nginx stream module with buildroot

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM