crysxd / OctoApp-Plugin

Companion plugin for OctoApp
GNU Affero General Public License v3.0
54 stars 4 forks source link

Webcam URL calculation in app #29

Closed gjedeer closed 1 year ago

gjedeer commented 1 year ago

I have Octoprint exposed behind nginx like https://domain/octoprint/. This worked great with Octoapp except for the webcam. It seems to have a hard coded webcam URL to https://domain/webcam/?action=stream - ignoring the path part of the URL.

Would it be possible to add the path part to the generated URL (or if for some reason it's impossible, add a separate setting to webcam URL?)

crysxd commented 1 year ago

Please report a bug via the apps FAQ and help menu so I can see the app logs and what the app is doing. What you describe should work.

Thanks!

crysxd commented 1 year ago

Just a hunch, if your path starts with a / the app will behave like you describe. Make sure it's actually a relative path, e.g. webcam/?action=stream and not /webcam/?action=stream

gjedeer commented 1 year ago

That helped, thanks!

If someone else comes across this problem: it looks like OctoApp is reading the Octoprint value from Settings->Webcam, where you set the URL yourself. That's what @crysxd is talking about. The relative path does not work but the absolute URL does. There's no setting in OctoApp itself.

crysxd commented 1 year ago

Thanks for the update! Yes, you are correct where the path is coming from. Just to clarify, with the base URL https://domain/octoprint/ as in your example, the absolute path /octoprint/webcam?action=stream should be equivalent to webcam?action=stream. The absolute path is appended to the host only (https://domain + /octoprint/webcam?action=stream) and the relative path on the full base URL (https://domain/octoprint/ + webcam?action=stream). The leading / is what makes the difference in absolute to relative path.

If that's not the case, please let me know, I need to double check this then