summarylogtreecommitdiffstats
path: root/0002-proxy-support.patch
blob: fe8c111f37c50fc7e980bcadbbd7e3e759d5ac40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: Kill Your TV <killyourtv@i2pmail.org>
Date: Wed, 27 Jun 2012 20:59:53 +0000
Subject: proxy support

---
 src/allmydata/node.py                |    4 ++++
 src/allmydata/scripts/create_node.py |    1 +
 2 files changed, 5 insertions(+)

diff --git a/src/allmydata/node.py b/src/allmydata/node.py
index a971c4e..84d1a98 100644
--- a/src/allmydata/node.py
+++ b/src/allmydata/node.py
@@ -185,6 +185,10 @@ class Node(service.MultiService):
             # N.B.: this is in seconds, so use "1800" to get 30min
             self.tub.setOption("disconnectTimeout", int(disconnect_timeout_s))
 
+        http_proxy = self.get_config("node", "http_proxy", "")
+        if http_proxy:
+            self.tub.setOption("http-proxy", http_proxy)
+
         self.nodeid = b32decode(self.tub.tubID.upper()) # binary format
         self.write_config("my_nodeid", b32encode(self.nodeid).lower() + "\n")
         self.short_nodeid = b32encode(self.nodeid).lower()[:8] # ready for printing
diff --git a/src/allmydata/scripts/create_node.py b/src/allmydata/scripts/create_node.py
index 7e9dcf7..09ef9bf 100644
--- a/src/allmydata/scripts/create_node.py
+++ b/src/allmydata/scripts/create_node.py
@@ -91,6 +91,7 @@ def write_node_config(c, config):
         webport = ""
     c.write("web.port = %s\n" % (webport.encode('utf-8'),))
     c.write("web.static = public_html\n")
+    c.write("#http_proxy =\n")
     c.write("#tub.port =\n")
     c.write("#tub.location = \n")
     c.write("#log_gatherer.furl =\n")