fortheusers / hb-appstore

Homebrew App Store - GUI for downloading/managing homebrew apps
https://hb-app.store
GNU General Public License v3.0
1.1k stars 64 forks source link

Switch+WiiU: Bypasses configured proxy #72

Open eku opened 3 years ago

eku commented 3 years ago

Describe the bug A proxy is configured in the Wi-Fi profile, without which the console cannot access the Internet. However, the App Store establishes a connection directly, which logically fails.

Platform: Switch + WiiU

To Reproduce Simply enter a proxy in the WiFi profile and do not allow direct connections to the Internet.

vgmoose commented 2 years ago

Presumably other Switch homebrews may also have this issue, and a similar fix should work.

InternalLoss commented 2 years ago

Presumably other Switch homebrews may also have this issue, and a similar fix should work.

Unsure of what it does differently, but nxdumptool does not have this issue I can confirm

vgmoose commented 2 years ago

Is the issue still present? I wonder if updating underlying libcurl libraries resolved it.

eku commented 2 years ago

It's still an issue.

vgmoose commented 2 years ago

Thanks- just confirming. I also should have mentioned the newer build in my last comment (from the Actions tab): https://github.com/fortheusers/hb-appstore/suites/8429699834/artifacts/373293764. This uses the newer libcurl.

eku commented 1 month ago

It's still an issue both on Switch and WiiU!

vgmoose commented 1 month ago

Ahh, okay. it sounds like we may need to manually, per each platform, load proxy settings and apply them directly using Curl opt flags: https://curl.se/libcurl/c/CURLOPT_PROXY.html

The strange thing is that it seems system proxies should be handled, but maybe this behavior is bugged or doesn't work for some reason in hb-appstore: https://github.com/devkitPro/curl/commit/af8d070c859d218c9112a16a7c11f632d06799fa

vgmoose commented 1 month ago

For reference:

hb-appstore curl code: https://github.com/fortheusers/libget/blob/d341dd58df4e6d231ec4840f64a12394a480c7ab/src/Utils.cpp#L198-L202

nxdumptool (for comparison): https://github.com/DarkMatterCore/nxdumptool/blob/14acd00559e7266029326c16eab0d2cc687d3176/source/core/http.c#L118

Probably to troubleshoot this, it's worth taking the curl example app, to see if 1. that works with the system proxy, and 2. whether or not manually loading it fixes it: https://github.com/switchbrew/switch-examples/tree/master/network/curl

And then try to remove or add curl flags to hb-appstore code until it behaves like the example.

eku commented 1 month ago

nxdumptool (for comparison): https://github.com/DarkMatterCore/nxdumptool/blob/14acd00559e7266029326c16eab0d2cc687d3176/source/core/http.c#L118

I don't see any curl option for proxy settings there. Are you sure, nxdumptool works behind a proxy?

vgmoose commented 1 month ago

Attached is a build of the curl_example that I mentioned earlier: curl_example.nro.zip

It displays an error if it fails to connect. It could be that one of the curl flags that hb-appstore adds on (such as the SSL certificate one) interferes with the proxy.