On the tor-talk mailing list the idea was developed to have a standalone flash proxy that does not require a browser (and thus a display) to run in. Useful to run 24/7 on/behind home router and the like, esp. where the address is changing daily.
David proposed using Rhino; there seem to be websocket clients for node.js as well. (How similar to a browser does this need to be?)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
On the tor-talk mailing list the idea was developed to have a standalone flash proxy that does not require a browser (and thus a display) to run in. Useful to run 24/7 on/behind home router and the like, esp. where the address is changing daily.
Great idea!
David proposed using Rhino; there seem to be websocket clients for node.js as well. (How similar to a browser does this need to be?)
My first thought is "hopefully not that similar to a browser at all" -- I can see porting the javascript browser stuff at first, but it seems to me that the protocol should be simple enough that a python script by itself should do it. Then we could imagine volunteers doing an apt-get install of the deb, and suddenly they're helping glue Tor users together, even behind nat, without ever having to think about it again. Extra points that these flash proxies would be way more stable than a typical browser tab.
My first thought is "hopefully not that similar to a browser at all" -- I can see porting the javascript browser stuff at first, but it seems to me that the protocol should be simple enough that a python script by itself should do it. Then we could imagine volunteers doing an apt-get install of the deb, and suddenly they're helping glue Tor users together, even behind nat, without ever having to think about it again. Extra points that these flash proxies would be way more stable than a typical browser tab.
Hey speaking of which: in the Flashproxy model, the Tor bridge needs some glue to pretend to be a webserver, since the Flash Proxy is only allowed to talk certain protocols.
This outside-the-browser standalone Flash proxy wouldn't have such a requirement -- does that mean it could (should) just interface with normal Tor bridges directly?
Hey speaking of which: in the Flashproxy model, the Tor bridge needs some glue to pretend to be a webserver, since the Flash Proxy is only allowed to talk certain protocols.
This outside-the-browser standalone Flash proxy wouldn't have such a requirement -- does that mean it could (should) just interface with normal Tor bridges directly?
Yes, correct, which is potentially very exciting for ideas like #7167 (moved), combining obfsproxy with flash proxy, because it allows us to escape the outer (fingerprintable) layer of WebSocket. There's no reason why a client couldn't speak obfs2, for example, through a standalone flash proxy, to any old obfs2 bridge.
Check comment:2:ticket:5578 regarding WebRTC, where I proposed having client registrations inform the facilitator of the types of connections they want. Currently we assume that all communication is WebSocket, both client–proxy and proxy–relay. It gets more complicated when client–proxy may be WebSocket, WebRTC, or raw TCP; and proxy–relay may be WebSocket, raw TCP, obfs2-in-WebSocket, or obfs2-in-raw TCP. E.g., a standalone proxy doesn't have to care whether it is carrying plain Tor or obfs2 in terms of making a connection, but it has to know which protocol the client plans to tunnel in order to connect to a bridge of the appropriate type.
This outside-the-browser standalone Flash proxy wouldn't have such a requirement -- does that mean it could (should) just interface with normal Tor bridges directly?
Yes, correct,
...or have the bridge locally. (I assume running rogue flashproxies is not a valid attack (on the content) as the tor client will verify the bridge and the network behind it.)
Check comment:2:ticket:5578 regarding WebRTC, where I proposed having client registrations inform the facilitator of the types of connections they want.
Good to know. I was thinking - for this standalone proxy the webbrowser-available-communication restriction no longer applies, so we could use other protocols as well (including UDP).
The main advantage of flashproxy that remains then is dynamic nature of discovery via the facilitator (and the reverse connection, o/c), and thus making me able to use my home DSL (which changes IP every day). Bridges need manual work every time that happens on the client side.
Here's an in-progress patch (attached to this bug) that I'm working on to allow node.js to run a flashproxy. It's not working yet; the commit message has more details.
I rebased cjb's work onto the HEAD of master and got this working. Also added a package.json file to simplify the npm install and fixed a small bug in the facilitator. This work can be found on the standalone branch of my github repo,
I rebased cjb's work onto the HEAD of master and got this working. Also added a package.json file to simplify the npm install and fixed a small bug in the facilitator. This work can be found on the standalone branch of my github repo,
Do you think you could rebase your changes into logical commits? For example, each bug fix should be its own commit, and the addition of package.json needs to be its own commit. Each commit needs to have an informative log message.
I'm not seeing anything move to e.g. "Relay: connected.", even though I'm sure (because I can connect to it in another terminal) that the relay host:port is up. Did it work okay for you?
About the changes generally, I would prefer that there be fewer if (BROWSER) blocks. There are too many now for this code to be merged. Ideally, all the node.js-specific stuff will be in one block at the top of the file, and other parts of the code will use abstractions set up by that block.
Even having to check event seems like a bug in the WebSocket library. My preferred solution here is to have the bug reported upstream and not to work around it here. The lack of bufferedAmount in https://github.com/arlolra/flashproxy/commit/4110c0f96273259b162d33ee3a7ed7542d0294c6 also seems like a bug, and ignoring it means we potentially use unbounded memory. The need to set { binary: true } looks like another bug. We could build an abstraction to hide the differences, but I don't want a wrapper function doing something that should be fundamental like send. Better to get these bugs fixed.
In summary: please report what look like bugs to the authors of the WebSocket library, and try to move the if (BROWSER) blocks into one place.
Ok, ignore my last two posts. The changes were merged upstream. I moved everything on top of the tracking branch you started. Definitely looks cleaner now. Enjoy!
Please don't merge from master in feature branches like this one, if you can avoid it. I would much rather have you rebase onto master, in the same branch or in a new branch. You should rebase to get rid of commits that do something and then later commits that revert them. In these branches, I'm not interested in history, I want something clean that I can apply to master. See comment:5:ticket:7751 for a example of asn making such a rebased "take2" branch.
Can you explain this code? What gets modified otherwise?
// Include flashproxy.js using eval to avoid modifying it.var file = path.join(__dirname, "flashproxy.js");var data = fs.readFileSync(file, "utf8");eval(data);
Node.js doesn't have the equivalent of Rhino's load(), where code gets included in the calling script. It does have require() but that follows the CommonJS pattern of explicitly exporting a module.
Rather than make any changes to flashproxy.js, we just read the file and evaluate it.
What gets modified otherwise?
All the above environment variables in flashproxy-node.js could be conditionally defined in flashproxy.js at the top, but I thought it cleaner to separate the code.
We still need documentation that is not just part of a commit message. It needs to be something we can update and link people to. Please add a README file stating how to run the standalone proxy. This should include instructions both for running from a source directory (node flashproxy-node.js) and the npm instructions.
Is it possible to mode the Node.js code to a new modules/nodejs directory?