Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web_proxy does not work with .pac files #182

Closed
christopher-lea-eu opened this issue Jun 20, 2016 · 0 comments
Closed

web_proxy does not work with .pac files #182

christopher-lea-eu opened this issue Jun 20, 2016 · 0 comments

Comments

@christopher-lea-eu
Copy link

christopher-lea-eu commented Jun 20, 2016

I'm trying to make my client application proxy aware, and using WinHttpGetIEProxyConfigForCurrentUser to get the proxy configuration before creating my HttpClient.
In many of my users cases this means lpszAutoConfigUrl = "http://something.com/proxy.pac".

However, it seems Casablanca does not handle this how I would expect. The .pac file is not parsed by casablanca and no correct proxy is subsequently set, as far as I can tell. A quick look through http_client_winhttp seems to suggest I can only use a direct proxy or WPAD auto discovery via DNS/DHCP?

How can I configure Casablanca to correctly use a .pac proxy?

Thanks,
Chris

vslavik added a commit to vslavik/poedit that referenced this issue Jun 22, 2016
WinHttp doesn’t automatically adopt system-wide/MSIE proxy settings,
causing non-obvious breakages. Per the
https://blogs.msdn.microsoft.com/ieinternals/2013/10/11/understanding-web-proxy-configuration/ guidelines,
use WinHttpGetIEProxyConfigForCurrentUser to configure proxy settings to
the extent possible (C++ REST SDK doesn’t support autoconfig URLs, see
microsoft/cpprestsdk#182).

Fixes #276.
vadz added a commit to vadz/cpprestsdk that referenced this issue Jul 8, 2017
Implement the recommended behaviour for "well-written WinHTTP apps", see
https://blogs.msdn.microsoft.com/ieinternals/2013/10/11/understanding-web-proxy-configuration/

I.e. use IE proxy settings for the current user unless WinHTTP proxy is
explicitly defined (which seems to be quite rare in practice). This makes
applications using C++ REST SDK work out of the box on the networks where IE
is configured to access the Internet (which will almost always be the case),
whether via a fixed proxy or using proxy-configuration, using either WPAD or
fixed PAC URL (this fixes microsoft#182
in passing).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant