From 6f324e9f859319778c201951051685d376c8e4db Mon Sep 17 00:00:00 2001 From: Ariel Calzada Date: Thu, 03 Jan 2013 18:12:34 +0000 Subject: Added proxy network support --- (limited to 'webactivity.py') diff --git a/webactivity.py b/webactivity.py index 3c0d337..c5f13c1 100644 --- a/webactivity.py +++ b/webactivity.py @@ -159,6 +159,11 @@ class WebActivity(activity.Activity): session.set_property('ssl-use-system-ca-file', True) session.set_property('ssl-strict', False) + # 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: -- cgit v0.9.1