adding endpoint plugins
dstainton415 at gmail.com
Wed Apr 30 13:42:30 UTC 2014
I wrote a simple IStreamClientEndpointStringParser for using the
SOCKS5ClientEndpoint with Tor:
I modified a txsocksx code example for testing the new endpoint descriptor:
...but I am not sure how to "register" it such that calls to
clientFromString can return this endpoint when the descriptor prefix
mentions placing the plugin in the twisted.plugins package... however this doc:
suggests that I can also set the PYTHONPATH to a directory:
"""if a directory which has been added to sys.path (typically by
adding it to the PYTHONPATH environment variable) contains a directory
named twisted/plugins/ , each .py file in that directory will be
loaded as a source of plugins."""
I'm using twisted 13.2.0 in a virtualenv... and I've tried setting
PYTHONPATH to a "twisted/plugins" directory no avail. I must be doing
something wrong here but after scouring the docs and twisted source
code... I'm just not sure.
This effort is part of solving for Tahoe-LAFS trac ticket 517:
"make tahoe Tor- and I2P-friendly"
Thanks to Glyph and JP's help I was able to write a foolscap client
side patch to use twisted endpoints. See foolscap trac ticket 203:
str4d has already written the foolscap server side endpoint patch...
Therefore it seems to me the next steps are to create parsers for
endpoints we are interested in supporting... and get Tahoe-LAFS to
register them so that serverFromString and clientFromString will
return the expected endpoint objects.
More information about the tahoe-dev