LibProxy+LibWebview: Add System Proxy Support#9679
Conversation
|
I think it will be great to add proxy settings reading from gsettings if running under gnome or from ~/.config/kioslaverc if running under KDE. |
|
Yes, I agree that we need to support some kde or gnome specific stuff. However, since almost every desktop environment has there own way to get proxy settings, it will be pretty a big work (we need to supports windows, gsettings, kde, xdp, and even android). I just want to get some feedback from maintainer before pushing this into a very huge pr. |
|
On windows it looks like the relevant API would be WinHttpGetIEProxyConfigForCurrentUser from winhttp.h. Requires linking Winhttp.dll. Not sure if you have access to a machine to test or not. If not this could be done later by someone else that ahs a windows machine. |
|
I thought the whole point of that proxy library was to query these platform-specific things? |
|
@alimpfard |
|
sorry, I meant libproxy from vcpkg. just what I remember you saying on discord. |
|
Yeah. But it's heavily rely on glib and many compiler extension of gcc&clang. It really difficult to make it works with msvc, which is our default compiler for vcpkg. (I have spent some days on it, but only find a very hacky way to patch it, which's, as expected, rejected by vcpkg...) And there are still some reason for turning to a self-contained lib:
|
|
so to be clear, the architecture I was suggesting before was that LibWeb would be the source of truth for these; RS should only get a ProxyData by ipc. |
|
What I understand from this is that libproxy(the dep) doesn't work well on windows (or maybe doesn't build) and doesn't either cache properly or is just suboptimal or both and as such the implementation from scratch. And we won't be pulling the dep. |
|
Yeah, that's what I means. Current version on vcpkg doesn't work at all. It has a huge refactor and switch to Gobject/glib, making the effort on patching it might be harder than writing one from scratch (the libproxy dep has less than 4000 line of c code and many of them is just to deal with PAC and js runtime). Re "LibWeb would be the source of truth": Oh, that's my bad. But I'm still very curious about why we allow LibWeb to determined the proxy? There are many states shared, for example, proxy cache. And Chromium handle proxy configuration in RS as well. |
largely an idealised view I have that proxies should be decided at the point a request is made; that would also allow later extensions to expose this to the user, or decide based on more than just the request URI.
That would be very surprising, can you point me at where this happens? I took a brief look and it seemed like the network service was getting its proxy configuration info from the outside (wherever that pipe is connected). |
|
@alimpfard |
abc858a to
cfdd1a4
Compare
|
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest |
cf8c36a to
623860f
Compare
|
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest |
There are several reason to drop libproxy port: - It works very badly with msvc, which is our default compiler for vcpkg package on Windows. - It doesn't support Android and BSD. This newly introduced LibProxy library currently implements basic proxy detection logic for macOS and environment variables.
- Update system proxy detect sequence in `Request.cpp` to make it compatible with disk cache - Clean up remaining debug message - Correct returned proxy type in `ProxyMacOS.cpp`
|
Thank you for taking the time to work on this pull request. As announced in "Changing How We Develop Ladybird", we are closing all currently open public pull requests as part of ending the public code contribution path for Ladybird. This is not a judgment on the quality of your work; we are very grateful for the effort you put into this pull request. But as of right now, code changes to the Ladybird codebase will only be introduced by project maintainers. We still welcome clear bug reports, reduced test cases, website testing, standards discussion, design discussion, security reports, and technical feedback. |
Replaces the external libproxy dependency with a new in-tree LibProxy library, adds system proxy detection (macOS currently and environment variables), and exposes proxy configuration through the browser's Settings UI.
LibProxy: A in-tree proxy library
ProxyDatafrom LibCore into LibProxy.http_proxy/HTTP_PROXY,https_proxy/HTTPS_PROXY, andall_proxy/ALL_PROXYenvironment variables. And uses the System Configuration framework to read system-wide proxy settings for HTTP, HTTPS, and SOCKS5.Service: integrate proxy with libcurl
Proxies detected by LibProxy are applied to HTTP requests via libcurl options.
LibWebView: Add "Proxy Mode" option in Settings UI
A new "Proxy Settings" element in the Network tab of
about:settings, with optionsUse system proxy settingsandNo proxy (Direct).LibCore+LibWeb: Remove unused code
Removed unused ProxyMappings from LibWeb.
Removed
proxy_dataparameter fromstart_requestIPC — proxy resolution now happens entirely server-side inRequestServer.Vcpkg: Dropped external libproxy dependency
Removed the libproxy vcpkg port — it worked poorly with MSVC and didn't support Android or BSD.