habnabit / txsocksx

SOCKS{4,4a,5} endpoints for twisted
ISC License
59 stars 37 forks source link

Optimistic data feature #15

Open evilaliv3 opened 8 years ago

evilaliv3 commented 8 years ago

Currently txsocksx seems to lack of any support for optimistic socks like specified and implemented in Tor: https://gitweb.torproject.org/torspec.git/tree/proposals/181-optimistic-data-client.txt https://trac.torproject.org/projects/tor/ticket/3564

The feature is already been implemented by the custom socks implementation integrated in tor2web: https://github.com/globaleaks/Tor2web/blob/master/tor2web/utils/socks.py

As shown in tor2web to implement the feature is really straightforward; simply it is possible to provide a callback to the user factory as the sock connection is enstablished by storing the data sent by the client in a temporary buffer to be pushed out upon real completion of socks setup.

habnabit commented 8 years ago

How would you want this to be exposed? Buffering is easy enough, but the exact desired semantics are not entirely clear. It seems like the naïve solution is to just allow users to say "I want to be an optimistic client" which will make the endpoint fire the returned Deferred as soon as the connection is established, expecting the server to report success.

evilaliv3 commented 8 years ago

yep! this is exactly my thinking.

i think a simple configuration variable at object instantiation would be enough

evilaliv3 commented 8 years ago

@habnabit can i remind you of this ticket ? :)