#Access local network mjpg server

42 messages · Page 1 of 1 (latest)

fresh stratus
#

Hi, I’m trying to build a robotics dashbord app. Long story short, I want to show an img with an src of http (the camera server doesn’t support HTTPS), but it gets auto-upgraded to HTTPS.

I tried playing with the csp/security config but that didn’t work.

Is there a way I can make something like this work in Tauri?

<img src=“http://192.168.100.100”>

eager venture
#

i don't think that the upgrade can be disabled.

Is it possible to include a localhost proxy? (no idea how that would work)
because even tho it should show the warning for http://localhost the request should still go through unmodified

#

in theory there is a browser argument (on windows) that should make it work, but there is currently no way to set that in a tauri app

fresh stratus
fresh stratus
eager venture
#

Oh btw, what OS are you on? @fresh stratus (btw the Platform and versions field in the github issue template is annotated with required)

fresh stratus
#

The problem is on Windows, I’m developing on macOS;
Sorry, I’ll add the platform info ASAP (wanted to add the issue and not forget)

eager venture
#

yeah alright, i answered as if you're on windows anyway.

You probably can't check if it's also an issue on macOS?

fresh stratus
#

I might be able to on the weekend

I just filled in details in the GitHub issue, thanks for all the help here. Should I add some details from this conversation to the issue?

eager venture
#

a link to this thread under "other information" is enough imo

fresh stratus
fresh stratus
#

If it will be easier to implement in a Tauri/Wry plugin that’d be great as well (I’m thinking of how to fix this)

fresh stratus
#

Thank you!

fresh stratus
eager venture
#

shit i should've included it in my message, i can't find it anymore

#

maybe --unsafely-treat-insecure-origin-as-secure=http://123.123

#

it wasn't --allow-running-insecure-content even though that should probably work

fresh stratus
#

I might be able to check this, do you know how I can switch my Tauri app to use my fork? I figure the rust part is easy, but how can I change the node CLI?

eager venture
#

changing the rust crates should be enough. I think the cli doesn't check the file anymore, does it?

fresh stratus
#

👌

fresh stratus
#

Thanks again Fabian. I tested this and it fixed the issue 😁

fresh stratus
#

@eager venture Sadly, even when passing —allow-running-insecure-content, the cameras don’t show. Attaching screenshot. Do you have any idea? The origin also didn’t work, and we have a competition in a couple of days 😬

#

Perhaps we need to change the CSP header somehow?

fresh stratus
#

That doesn’t seem to fix it. I think the webview might not be getting the args

eager venture
#

i'm a bit confused. didn't you say that it worked 2 months ago? 😅

fresh stratus
#

Yep. I believe it did work, which makes it 10 times more confusing and exhausting…

fresh stratus
#

Any ideas? @eager venture

eager venture
#

well i mean we're back at the beginning it seems so we're also back at the same ideas i already mentioned x)

so like, use tauri from git and use the args api to tell it to stop crying about insecure content. The only relevant flags i can think of are these:
--allow-running-insecure-content
--unsafely-treat-insecure-origin-as-secure=http://ip123
--disable-web-security
--allow-insecure-localhost

If none of them work you could try https://github.com/tauri-apps/plugins-workspace/tree/dev/plugins/localhost and if that doesn't work either i'm at a loss

fresh stratus
#

My best guess would be that the flags are no longer being correctly passed to the Webview, perhaps because of a microsoft update or something. Could that be the case?

I did try to add the above flags and they also didn’t work

#

Maybe there’s a flag I can put in to see if flags work in general?

eager venture
#

i just did that this week so it's the only flag i can actually tell is supposed to work

fresh stratus
#

How do I navigate to it?

eager venture
#

set the window url to it, or open the dev tools and use window.location.replace()

fresh stratus
#

I will try that asap

fresh stratus
#

It does seem to be the issue that browser args are no longer getting passed

eager venture