IP webcam [Phone](pihole tailscale) incorporate

Camera model
Samsung a20e

What is the problem?
When connecting locally it works fine, the camera image shows up on the controls page .
But when I'm connecting remotely trough tailscale(vpn), it does not work.
Long story short ,I have a separate raspberry that runs pihole, octopi and my ip phone camera is configured trought pihole (It has a local dns entry), in octopi the Stream URL is:

Very important , the phone camera is not introduced to the vpn tunnel (it does not have a vpn ip),so i can't access it trough vpn.

My question is that why does this occur, more exactly
I can access an octopi instance locally that can access the video stream.
But when I'm connecting to a octopi instance remotely, it does not see that stream anymore...
I know that stream URL does not exist for me (the vpn user), because it's not introduced to the vpn tunnel, but for octopi it still exists locally ,why can't it show it to me ?

This issue probably could be solved by introducing the camera to the vpn tunnel (make for the camera a vpn ip), but then I dont know how to automate switching between the streams (Use the local stream when connected to octopi localy and use the vpn stream when connected from a vpn user)

OctoPrint doesn't proxy the webcam stream through its own server, this would cause unnecessary resource usage. In your browser, the UI tries to embed the stream directly using the URL you give it. Since it's not connected to your VPN, it can't be embedded.

1 Like

you could potentially configure your haproxy in octopi pi to redirect the /webcam/ folder to that ip camera to load through it and then you should be able to access over the tailscale network.

Thank you for your quick and reinforcing response!
That is what I tought , so I need to add my ip cameras to my vpn as well , but there still remains the automatic switch problem between views....

if you go the route of haproxy config like I said then there is no switching. you configure the webcam stream url as /webcam/... for example. doesn't matter how you access, because it's relative and because the pi running haproxy is in the network it will reverse proxy the ip camera to the front-end.

1 Like

Yup it's working , thank you !

I'm pretty new to this whole thing - I got haproxy.cfg open in WinSCP, can @jneilliii or @czerjak22 detail exactly what I need to change in order to get my IP camera (also a phone) accessible through tailsacle?

Change the bit that looks like this.

backend webcam
        reqrep ^([^\ :]*)\ /webcam/(.*)     \1\ /\2
        server webcam1
        errorfile 503 /etc/haproxy/errors/503-no-webcam.http

replacing the part with the ip:port of the phone's URL to access the stream.

That didn't work - but my haproxy.cfg doesn't exactly look like that. Here's what mine looks like:

Thanks for the response, even though this thread is 3 months old!

Also, that's obviously not WinSCP like I mentioned in my original comment, I ran into permission issues so I'm using the nano editor over SSH instead.

after making the change did you restart haproxy (sudo service haproxy restart) or reboot the pi? I assume that you access your stream as basically replace the part of your URL with http://<ip of octoprint>/webcam/.

I did, but I wasn't going to the correct URL to see if my stream was up....Went there now and I can see the IP Webcam portal but am getting this error.

I'm just using the classic IP Webcam app, not sure if you have any ideas but thanks for all the help so far anyways, I'm a damn noob lmao