[Sugar-devel] [PATCH] Browse added proxy support with http_proxy variable

Ariel Calzada ariel.calzada at gmail.com
Wed Jan 2 08:18:30 EST 2013


From: Ariel Calzada <aricalso at 000PaRaDoX000.(none)>

This patch adds support for proxy in the Browse activity.
Honors the variable http_proxy

---
 webactivity.py |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/webactivity.py b/webactivity.py
index d140128..5ae0358 100644
--- a/webactivity.py
+++ b/webactivity.py
@@ -157,6 +157,11 @@ class WebActivity(activity.Activity):
         session = WebKit.get_default_session()
         session.set_property('accept-language-auto', True)
 
+        # Honor the http_proxy variable
+        if os.environ.get('http_proxy') is not None:
+            proxy_uri = Soup.URI.new(os.environ['http_proxy'])
+            session.set_property("proxy-uri",proxy_uri)
+
         # By default, cookies are not stored persistently, we have to
         # add a cookie jar so that they get saved to disk.  We use one
         # with a SQlite database:
-- 
1.7.10.4



More information about the Sugar-devel mailing list