[Mono-docs-list] Proxy patch

Mario Sopena Novales masono1@teleco.upv.es
Tue, 25 Jan 2005 12:31:55 +0100


--=-mSYRFfjBO19210qBPSSc
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi guys,
	because I'm behind a proxy right now I couldn't upload my contributions
to monodoc, so I've added support for a proxy. It looks in
the /system/http_proxy registry key. That works for me but I've not
tested in other places.

Mario


--=-mSYRFfjBO19210qBPSSc
Content-Description: 
Content-Disposition: attachment; filename=Changelog
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

2005-01-25 Mario Sopena novales <masono1@teleco.upv.es>

	* browser/Contributions.cs: Look in GConf for a proxy and use it

	* browser/Makefile.am: Add a reference for gconf-sharp

--=-mSYRFfjBO19210qBPSSc
Content-Disposition: attachment; filename=proxy.diff
Content-Type: text/x-patch; name=proxy.diff; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Index: Contributions.cs
===================================================================
--- Contributions.cs	(revision 38046)
+++ Contributions.cs	(working copy)
@@ -18,8 +18,18 @@
 System.ComponentModel.DesignerCategoryAttribute("code")]
 public class ContributionsSoap : System.Web.Services.Protocols.SoapHttpClientProtocol {
 
+    static string PROXY_HOST = "/system/http_proxy/host";
+    static string PROXY_PORT = "/system/http_proxy/port";
+    static string USE_PROXY = "/system/http_proxy/use_http_proxy";
+
     public ContributionsSoap () {
         this.Url = "http://localhost:8080/server.asmx";
+	//Looks in GConf for a proxy
+	GConf.Client gconf = new GConf.Client();
+	string proxy = (string) gconf.Get (PROXY_HOST) + ":" + (int) gconf.Get (PROXY_PORT);
+	bool use_proxy = (bool) gconf.Get(USE_PROXY);	
+	if (use_proxy)
+		System.Net.GlobalProxySelection.Select = new System.Net.WebProxy(proxy, true);
     }
 
     /// <remarks>
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 38046)
+++ Makefile.am	(working copy)
@@ -60,7 +60,7 @@
 cs2ecma_sources = \
 	$(srcdir)/cs2ecma.cs
 
-browser_assemblies = -pkg:gtkhtml-sharp -pkg:glade-sharp -r:System.Web.Services
+browser_assemblies = -pkg:gtkhtml-sharp -pkg:glade-sharp -pkg:gconf-sharp -r:System.Web.Services
 
 EXTRA_DIST = \
 	$(monodoc_sources) $(assembler_sources) \

--=-mSYRFfjBO19210qBPSSc--