diff --git src/allmydata/node.py src/allmydata/node.py
index 7f5bf61..f55ba3f 100644
|
|
class Node(service.MultiService): |
155 | 155 | # N.B.: this is in seconds, so use "1800" to get 30min |
156 | 156 | self.tub.setOption("disconnectTimeout", int(disconnect_timeout_s)) |
157 | 157 | |
| 158 | http_proxy = self.get_config("node", "http_proxy", "") |
| 159 | if http_proxy: |
| 160 | self.tub.setOption("http-proxy", http_proxy) |
| 161 | |
158 | 162 | self.nodeid = b32decode(self.tub.tubID.upper()) # binary format |
159 | 163 | self.write_config("my_nodeid", b32encode(self.nodeid).lower() + "\n") |
160 | 164 | self.short_nodeid = b32encode(self.nodeid).lower()[:8] # ready for printing |
diff --git src/allmydata/scripts/create_node.py src/allmydata/scripts/create_node.py
index 928add1..ff514d5 100644
|
|
def write_node_config(c, config): |
79 | 79 | webport = "" |
80 | 80 | c.write("web.port = %s\n" % (webport.encode('utf-8'),)) |
81 | 81 | c.write("web.static = public_html\n") |
| 82 | c.write("#http_proxy =\n") |
82 | 83 | c.write("#tub.port =\n") |
83 | 84 | c.write("#tub.location = \n") |
84 | 85 | c.write("#log_gatherer.furl =\n") |
diff --git src/allmydata/test/test_node.py src/allmydata/test/test_node.py
index 24ec571..08593ef 100644
|
|
class TestCase(testutil.SignalMixin, unittest.TestCase): |
31 | 31 | d.addCallback(flushEventualQueue) |
32 | 32 | return d |
33 | 33 | |
| 34 | def test_http_proxy(self): |
| 35 | basedir = "test_node/test_http_proxy" |
| 36 | fileutil.make_dirs(basedir) |
| 37 | f = open(os.path.join(basedir, 'tahoe.cfg'), 'wt') |
| 38 | f.write("[node]\n") |
| 39 | f.write("http_proxy = 127.0.0.1:8888\n") |
| 40 | f.close() |
| 41 | |
| 42 | n = TestNode(basedir) |
| 43 | self.failUnlessEqual(n.tub.options['http-proxy'], "127.0.0.1:8888") |
| 44 | |
34 | 45 | def test_location(self): |
35 | 46 | basedir = "test_node/test_location" |
36 | 47 | fileutil.make_dirs(basedir) |