mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-17 23:08:21 +00:00
tahoe.cfg: add tub.port=listen:i2p (and/or listen:tor)
This delegates the construction of the server Endpoint object to the i2p/tor Provider, which can use the i2p/tor section of the config file to add options which would be awkward to express as text in an endpoint descriptor string. refs ticket:2889 (but note this merely makes room for a function to be written that can process I2CP options, it does not actually handle such options, so it does not close this ticket yet)
This commit is contained in:
@ -393,6 +393,20 @@ class Provider(unittest.TestCase):
|
||||
self.assertIs(h, handler)
|
||||
tor.default_socks.assert_called_with()
|
||||
|
||||
class Provider_Listener(unittest.TestCase):
|
||||
def test_listener(self):
|
||||
tor = mock.Mock()
|
||||
handler = object()
|
||||
tor.socks_endpoint = mock.Mock(return_value=handler)
|
||||
reactor = object()
|
||||
|
||||
with mock_tor(tor):
|
||||
p = tor_provider.Provider("basedir",
|
||||
FakeConfig(**{"onion.local_port": "321"}),
|
||||
reactor)
|
||||
endpoint_or_description = p.get_listener()
|
||||
self.assertEqual(endpoint_or_description, "tcp:321:interface=127.0.0.1")
|
||||
|
||||
class Provider_CheckOnionConfig(unittest.TestCase):
|
||||
def test_default(self):
|
||||
# default config doesn't start an onion service, so it should be
|
||||
|
Reference in New Issue
Block a user