justcoding121 / titanium-web-proxy

A cross-platform asynchronous HTTP(S) proxy server in C#.
MIT License
1.92k stars 598 forks source link

"Setting system proxy settings are only supported in Windows" while in Windows MAUI App #936

Open ricardoboss opened 1 year ago

ricardoboss commented 1 year ago

Getting "Setting system proxy settings are only supported in Windows. Please manually configure you operating system to use this proxy's port and address." in MAUI (.NET 7) on Windows.

ms777 commented 1 year ago

I had the same problem. I am using Titanium from Powershell. After upgrading from Powershell 7.2.7 (.Net 6) to Powershell 7.3 (.NET 7) my script stopped working

Eonasdan commented 1 year ago

For Maui this is because IsRunningAsUwp returns true

Eonasdan commented 1 year ago

MAUI is apparently sandboxe like UWP. If I comment out the check for uwp, maui does set the "registry", sort of. It sets the sandbox register. The maui app is then proxied through titanium but not outside requests (e.g. Chrome). The solution would be to either have a full trust companion (console app) that could adjust the system proxy or if you're just using Maui for the Blazor option then I'd ditch Maui for WPF + Blazor.

If you're interested in getting wpf + blazor to work let me know and I can pass on some additional info.

ricardoboss commented 1 year ago

So, in short, you're saying Titanium Proxy cannot run in MAUI apps on Windows?

Eonasdan commented 1 year ago

It can but you'd have to set the registry values yourself and fork the code to by-pass the UWP check.