[Mono-osx] Accessing a web service through a Web Proxy

Anthony Bowker anthony at flowol.com
Thu Sep 18 19:25:47 EDT 2008

Hi there,


I have written a client application using Mono running on Mac OSX which is a
client to my .NET web service (running on WS2K8).  I'm using VS 2K8 to
author my mono client and so used that to create my web reference and
generate my proxy class.  Thus, in my client I have code as such:


using (MyService service = new MyService ())


    //service.Proxy = something?




This works fine on a Mac that is directly connected to the internet, but
fails when the Mac is behind a Web Proxy.  What I want is for my mono client
to use the Web Proxy settings that the user has already entered for their
computer in System Preferences -> Network -> Advanced -> Proxies -> Web
Proxy (HTTP).


According to the Microsoft documentation for the HttpWebClientProtocol.Proxy
Property, by default uses the operating system proxy settings.


What I've tried:

1. I've tried assigning service.Proxy = WebRequest.GetSystemWebProxy(), but
this doesn't work.

2. Mono 1.9.1 and 2.0 RC 1, no change


Possible ideas:

1. Use a native OSX API to get hold of the system proxy info, create my own
WebProxy object and use that.  Can anyone comment which would be the API to
look at here?

2. Add some ugly UI to make the user enter their proxy details specifically
for my app.


I am grateful for your suggestions.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20080918/0dc9ebdd/attachment.html 

More information about the Mono-osx mailing list