UWNetworksLab / colony

Apache License 2.0
5 stars 1 forks source link

Colony ported to a Chrome app #28

Open kennysong opened 8 years ago

kennysong commented 8 years ago

Colony works as a Chrome app by reusing some of the existing Cordova code, and the node modules ssh2 and socksv5. It can be built with gulp build_chrome_app.

I modified tcp.js and net.js from freedom-social-xmpp further for it to work (server ports, etc).

This is currently testable/demoable by running the app and doing curl --socks5 localhost:1080 http://ifconfig.co. However, there are two issues that need to be resolved before this can be used for practical purposes: https://github.com/uProxy/colony/issues/26 https://github.com/uProxy/colony/issues/27

Review on Reviewable

kennysong commented 8 years ago

Also, there are a few node_modules specifically added inside lib since pkgify doesn't handle substituting individual files well (if there are relative path imports in those files). See: https://github.com/uProxy/colony/blob/d494208b39906b55f5b921efa8d5e97916dc1f69/gulpfile.js#L74

ryscheng commented 8 years ago

It's kinda hard to review this when most of the code is dependencies. Can we either: 1.) figure out how to make pkgify use typical NODE_PATH (e.g. node_modules/) instead of relative files or 2.) .gitignore the things you copied into lib/ and make a copy task before the build

Either way, we just wanna remove node dependencies from the commits

kennysong commented 8 years ago

So this is because I had to change various files of the modules socksv5 and ssh2-streams, and I couldn't get pkgify to use the actual module on npm with the specific files that I changed, since those files have relative imports.

ryscheng commented 8 years ago

Can you point me to the changes, the nature of the changes? Are these things that you should submit pull requests upstream for?

kennysong commented 8 years ago

Sorry for the late response – was working on my intern presentation.

Anyway, I've figured out how to include the changes without copying the entire module over. There are only a few files in ssh2-streams and socksv5 that were modified (minor changes to make them work in browserify and Chrome, nothing to PR). We only keep the modified files in chrome-app/lib/, and copy everything else over during build.

This has two implications: we have to pin the versions of these two modules, since a small change might break functionality, and gulp build_chrome_app is no longer parallelized, since we have to copy before browserifying.

This should be much easier to review now. Also, you can probably just ignore the files in chrome-app/lib/socksv5 and chrome-app/lib/ssh2-streams (or just everything in lib/, really).