'Redirecting video stream from HTTPS to local net

I have a Kotlin app that displays live video from some HTTPS URLs, mainly IPTV channels (.m3u8) and live YouTube streams. However, I face the issue of many users inside my network accessing the same few streams.

Is there a way for me to setup a server that connects to the streaming URLs and redirects it to people inside an intranet to watch the stream? I'm stuck on how to send the server data through a P2P connection without redirecting the client app to the source stream. I'm thinking of using rust webrtc to listen to the stream and send the data, but I'm not sure how to do it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source