this post was submitted on 15 Jan 2025
28 points (91.2% liked)

Selfhosted

41123 readers
815 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Hello,

I've attached a diagram of the setup I'm trying to achieve. Hopefully its clearer than trying to explain it with text...

Basically I'm trying to stream the camera to a selfhosted webpage.

The camera is connected to the VPN server

The stream is picked up on the Media Server (MediaMTX)

The stream is available from anywhere on the local network via whatever protocol MediaMTX offers. All good here.

The webserver set up is Nginx. Works fine.

A basic Wordpress site is set up and I can access it via a domain name over the internet with HTTPS.

What I'm struggling with is getting the "local stream" (read local IP) in to the website. I have WP plugins that let me embed streams, but I suspect the issue is the local IP is not available over the internet so you cant just point it to 192.X.X.X. Saying that though, even on my local network I cant see the stream.

So the questions are,

  1. how can I serve the stream to nginx/ wordpress and
  2. can I somehow have nginx treat the stream as a locally hosted resource that can proxy the stream to remote web browsers?

Ideally I dont want to open up a port on the LAN for a direct streaming to the internet which the website then points to as it seems a unsafe... But if that's the only way then I guess it can''t be helped.

Happy to provide more info if needed.

TIA

Edit: Wordpress is for a separate website project outside of the scope of this post. Only 1 page will be for the video player/ stream but there will be other uses for the website. Not just streaming

Edit 2: Seems the general consensus is that I do need to publicise my video stream.

I've just made my website accessible through its local IP and gotten embedded HLS and WebRTC streams working. Putting the domain back no longer plays the videos so its certainly a networking access issue or even a https issue as the streams are currently http.

I didn't realise you could reverse proxy a video stream! (Even though i did once upon a time use the nginx rtmp server).

I've also been made aware of tailscale + funnel which does a similar thing without exposing my own domain.

I'll have a go at reverse proxying it, which should also sort out the https issue and hopefully be done 🤞

You guys rock!

you are viewing a single comment's thread
view the rest of the comments
[–] EarMaster 7 points 2 days ago (1 children)

That's the way to do it. The problem is that the request originates from the browser of you website visitor. You need to open a path for them to you media server. Nginx and it's reverse proxy functionality is exactly what you need for that.

[–] abominable_panda 2 points 2 days ago

Seems this is the way to go amongst all the replies. Didn't realise i could reverse proxy a camera stream! Thank you