-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Use system proxy configuration on macOS #24799
Comments
We are looking at having to implement this for our app. Would be nice if this was part of corefx. |
@wfurt Does curlhandler read the system proxy settings on osx? |
no, it does not. That is what I marked it as enhancement. |
I have some of this work done in my own library. The only further steps needed are to react to the auto proxy url. The work will be on this branch until it is merged. I tried to navigate through the proxies once in corefx, but I got lost on the way through the maze of indirection. If someone wants to point me at a file and say "it should go here" then I can see about making a PR. From what I understand, the API for getting the system proxy is not decided yet. |
Mono already has an implementation, and I've used this implementation to test locally that it works for all proxy scenarios:
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/MacProxy.cs Porting it is easy as well.. |
I was looking into it and loosely porting the Mono implementation to fit CoreFX. There are two possible approaches to take:
The problem of the managed code is that it gets rather ugly due to all the Interop wrappers. There's no direct way to load fields from native libraries, so it has to do Opinions? |
@filipnavara, thanks for looking into it. If it's feasible, my preference would be (2), or if the shim needs to be used, having the shim be 1:1 as best as possible with the underlying macOS APIs.
Can you elaborate on this? What changes would cause a correctly implemented managed implementation to break but a corresponding native one to not break? |
My biggest concern are exported The above problem is not a big one if you are aware of it, but since there's no I will share prototype with the managed only version once I get to office on Monday. It will be easier to explain on actual code :) |
Note that CFString and other Apple types are already exposed in Interop layer. One could probably used the Managed surface without creating System.Net.Http.Native.Apple. |
I am well aware of that and reused them in my prototype. |
Here's my branch: dotnet/corefx@master...filipnavara:macproxy It only handles basic proxy settings, no auto-configuration and no credentials. It shows most of the interop code that has to be added to make it managed-only. The original Mono implementation uses a system for passing the system proxy credentials that is incompatible with This is just enough to make HTTP debugging tools like Fiddler/Charles working. |
cc: @davidsh |
There is still a TODO in the code to handle reading system proxy credentials for the Mac. |
Maybe @filipnavara would know, but I did not even figure out how to put in password for proxy on my mac. |
Triage: Last left piece is passwords. |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
MacOS has system proxy configuration similar to Windows. To have better integration with OS it may be handy to use this instead of relying on environment variables.
One different caveat is that the proxy is specific to interfaces we we would need to find active interface first
The text was updated successfully, but these errors were encountered: