can I send stream from one mediasoup router to another router on different host if another router is behind NAT

I want to send streams from one mediasoup server to another
mediasoupServerA -----> mediasoupserverB
but mediasoupbserverB is behind NAT.
pipeToRouter does provide some implementations to do that but what if on the the server is behind NAT and does not have a public ip.

Can you forward ports on the NAT? If yes, then just forward a range of ports to mediasoupserverB and set the announcedIp of mediasoupserverB to that of the NAT. Don’t forget to limit the range of ports alloted to mediasoup to those that you forwarded from the NAT to mediasoupserverB.

thanks for your reply ,
i cannot forward the port because mediasoupserverB can also be behind a career grade NAT

basically i want to do some client side processing with gstreamer and then display the stream to client , i can run node and gstreamer on client side (i am using electron ).
i tired using mediasoupbin(gstreamer plugin) to consume the stream directly in a gstreamer client from the mediasoup server it works fine locally but after hosting it on aws i can not get the stream in client gstreamer (mediasoupbin_py) probably because of NAT.
now i am thinking of changing the architecture something like this
stream will flow like this
mediasoupclinentA ---->mediasoupserver ------->mediasoupserver running on clinet------> gstreamer ---------->mediaosupserver running on client -----> mediaosupclientB browser (Electron.js)

since mediasoupclient.js does not provide any api to produce stream as RTP so that i can get the stream in gstreamer therefore i am thinking of using mediasoup server on client side so that i can get the stream in gstreamer .

In general I like to keep “probably” out of the equation. I would make sure that this is the problem and see if/how I can fix it before re-architecting a solution.

Hint: mediasoup clients do work behind NAT.

1 Like