Why curl Doesn’t Pick Up the Windows Browser Proxy
Distinguish libcurl proxy inputs from Windows browser proxy discovery and automatic configuration.
A Windows browser working through the company proxy does not establish that a libcurl-based application has discovered the same configuration. libcurl has documented proxy options and environment variables; Windows browser proxy discovery is another interface.
An application that wants to follow the current user's Windows settings can query them using the Windows proxy-configuration API. That still leaves work to do. An automatic-configuration URL points to a PAC policy, not a fixed proxy endpoint suitable for copying directly into CURLOPT_PROXY.
- Manual proxy setting
- Parse the supported configuration and supply the appropriate proxy and bypass options to the client.
- PAC or automatic discovery
- Evaluate the policy for the actual destination using a supported integration.
- Background service
- Check which account owns the effective configuration; the interactive user's settings may not be the service's settings.
For a small diagnostic request, an explicit libcurl proxy option removes discovery from the comparison. A bounded curl command can check the same HTTP endpoint independently. For a managed application, implement the intended discovery policy rather than relying on a browser's successful request as proof of shared configuration.