Opened 5 years ago

Closed 5 years ago

#7016 closed enhancement (fixed)

Make flashproxy-client a managed proxy.

Reported by: dcf Owned by: dcf
Priority: Medium Milestone:
Component: Archived/Flashproxy Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Make flashproxy-client a managed proxy for ease of use and ease of integration in bundles. Currently it works only as an external proxy.

Ticket #5575 discusses managedness on the relay side.

Child Tickets

TicketTypeStatusOwnerSummary
#7208enhancementcloseddcfUse TOR_PT_STATE_LOCATION for temporary files if defined

Change History (5)

comment:1 Changed 5 years ago by asn

Hi David,

pyptlib should be able to help you with this task. I also wrote (hopefully helpful) documentation of the API that can be found in http://pyptlib.readthedocs.org/en/latest/

If you need more help, just send me an email or reply to this ticket.

(BTW, was planning on helping you use pyptlib, but unfortunately we ended up not meeting IRL.).

comment:2 Changed 5 years ago by dcf

Status: newneeds_review

Here is an implementation for review:

https://gitweb.torproject.org/user/dcf/flashproxy.git/shortlog/refs/heads/managed

Some thoughts:

  • It uses a --managed option. Maybe, since this is planned to be the most standard use, --managed should be the default and --external be an option?
  • What's the best way to ship a default torrc? I am using the path ./flashproxy-client in the torrc, which works if you run from the source directory, but not if you install to /usr/local/bin.

comment:3 in reply to:  2 ; Changed 5 years ago by asn

Replying to dcf:

Here is an implementation for review:

https://gitweb.torproject.org/user/dcf/flashproxy.git/shortlog/refs/heads/managed

The code looks sane.

Although, I'm wondering: why did you implement proposal 180 on your own and didn't use pyptlib? The main reason we wrote pyptlib is so that you don't have to implement proposal 180. Did you not like the API, did you find the documentation unreadable, or did you just want to implement something on your own?

In any case, the code looks good. Did you test it with Tor? Does it work?
I will monitor #5575 for the server-side case.

Some thoughts:

  • It uses a --managed option. Maybe, since this is planned to be the most standard use, --managed should be the default and --external be an option?

Yeah, I've been thinking about this myself too.

I still haven't decided if it would be helpful (because you don't have to append --managed in the end of the ClientTransportPlugin line), or confusing (who try to execute 'flashproxy' and get "ENV-ERROR Cannot find TOR_PT_STATE_LOC" in stdout) to people.

  • What's the best way to ship a default torrc? I am using the path ./flashproxy-client in the torrc, which works if you run from the source directory, but not if you install to /usr/local/bin.

Hm, what do you mean?

If you are asking how you would spawn flashpproxy in a Tor Browser Bundle; you would probably have a ClientTransportPlugin line like this:
ClientTransportPlugin websocket exec ./App/flashproxy-client --managed
and flashproxy-client would be placed in the top-level /App/ directory of the Tor Browser Bundle.

comment:4 in reply to:  3 Changed 5 years ago by dcf

Thank you for the review.

Although, I'm wondering: why did you implement proposal 180 on your own and didn't use pyptlib? The main reason we wrote pyptlib is so that you don't have to implement proposal 180. Did you not like the API, did you find the documentation unreadable, or did you just want to implement something on your own?

I'm sorry about that; it was a combination of laziness and ignorance. When I first tried pyptlib over the summer, I was afraid of how it used monocle and wanted me to use its event loop, which would not have worked for flashproxy-client. Then I heard that you were reimplementing it using Twisted, and was still unsure. Now I see that pyptlib does not do anything besides the env/stdout part of proposal 180, which I think is a good idea. I had already started implementing #5575 in a language other than Python, so I understood proposal 180 well enough to plug in the new code.

In any case, the code looks good. Did you test it with Tor? Does it work?

It works; the environment variables and writing to stdout worked as soon as I remembered to flush stdout. I also set the local listening port to 0 so that it is chosen by the OS in managed mode.

Some thoughts:

  • It uses a --managed option. Maybe, since this is planned to be the most standard use, --managed should be the default and --external be an option?

Yeah, I've been thinking about this myself too.

I still haven't decided if it would be helpful (because you don't have to append --managed in the end of the ClientTransportPlugin line), or confusing (who try to execute 'flashproxy' and get "ENV-ERROR Cannot find TOR_PT_STATE_LOC" in stdout) to people.

I think I will do this. We can detect when the user is running from a tty, for example, and give a nice error message to stderr.

VERSION-ERROR no-version
If you are running flashproxy-client from the command line and not
from a ClientTransportPlugin configuration line, you must use the
--external option.
  • What's the best way to ship a default torrc? I am using the path ./flashproxy-client in the torrc, which works if you run from the source directory, but not if you install to /usr/local/bin.

Hm, what do you mean?

If you are asking how you would spawn flashpproxy in a Tor Browser Bundle; you would probably have a ClientTransportPlugin line like this:
ClientTransportPlugin websocket exec ./App/flashproxy-client --managed
and flashproxy-client would be placed in the top-level /App/ directory of the Tor Browser Bundle.

I can see how it will work for a TBB. I am thinking of someone who downloads the flashproxy-client package and does make install. They will have to edit the included torrc in order to make it point to /usr/local/bin. They will also have to find a place to store the torrc. I was just wondering if there was a standard way to do this for people who download obfsproxy by itself.

comment:5 Changed 5 years ago by dcf

Resolution: fixed
Status: needs_reviewclosed

This is implemented now in the flashproxy-client 0.8 release. I decided to make managed mode the default, and add an --external option to turn it off.

Note: See TracTickets for help on using tickets.