In Mono on OSX how do I get access to the current

2019-05-11 13:26发布

问题:

Both GetSystemWebProxy and DefaultWebProxy return null.

WebRequest.GetSystemWebProxy();
WebRequest.DefaultWebProxy;

回答1:

If you use a recent version of monomac (or build it from source) then you should be able to call the static method CFNetwork.GetDefaultProxy (source, look at the end of the file) to get an IWebProxy instance that should match what OSX is using.