From 46bf93b021cf19b4cf2b88e60546bf6e6b5f50ec Mon Sep 17 00:00:00 2001 From: soycode Date: Tue, 7 Jun 2016 10:11:23 -0700 Subject: [PATCH 1/2] add simple socks for node --- Gruntfile.coffee | 10 ++++++++++ src/lib/samples/simple-socks-node/index.js | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/lib/samples/simple-socks-node/index.js diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 9a60e3fd2b..fdf35369ee 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -710,6 +710,15 @@ gruntConfig = { 'freedom-port-control' ] localDestPath: 'lib/samples/simple-socks-firefoxapp/data/' + libsForSimpleSocksNode: + Rule.copyLibs + npmLibNames: ['freedom-for-node'] + pathsFromDevBuild: ['simple-socks', 'churn-pipe', 'loggingprovider'] + pathsFromThirdPartyBuild: [ + 'uproxy-obfuscators' + 'freedom-port-control' + ] + localDestPath: 'lib/samples/simple-socks-node/' libsForSimpleChatChromeApp: Rule.copyLibs @@ -1133,6 +1142,7 @@ taskManager.add 'simpleSocks', [ 'browserify:simpleSocksFreedomModule' 'copy:libsForSimpleSocksChromeApp' 'copy:libsForSimpleSocksFirefoxApp' + 'copy:libsForSimpleSocksNode' ] taskManager.add 'uprobe', [ diff --git a/src/lib/samples/simple-socks-node/index.js b/src/lib/samples/simple-socks-node/index.js new file mode 100644 index 0000000000..5fdda86031 --- /dev/null +++ b/src/lib/samples/simple-socks-node/index.js @@ -0,0 +1,10 @@ +var freedom = require('freedom-for-node'); + +freedom.freedom('./uproxy-lib/simple-socks/freedom-module.json', { + 'logger': './uproxy-lib/loggingprovider/freedom-module.json', + 'debug': 'debug' +}).then(function(moduleFactory) { + moduleFactory(); +}, function(e) { + console.error('could not load freedomjs module: ' + e.message); +}); From 4caff6ac469acea810463c577c197021e512993a Mon Sep 17 00:00:00 2001 From: soycode Date: Fri, 10 Jun 2016 15:01:19 -0700 Subject: [PATCH 2/2] fix socks-node paths --- Gruntfile.coffee | 2 +- src/lib/samples/simple-socks-node/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index fdf35369ee..3ac830c3d6 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -713,7 +713,7 @@ gruntConfig = { libsForSimpleSocksNode: Rule.copyLibs npmLibNames: ['freedom-for-node'] - pathsFromDevBuild: ['simple-socks', 'churn-pipe', 'loggingprovider'] + pathsFromDevBuild: ['lib/simple-socks', 'lib/churn-pipe', 'lib/loggingprovider'] pathsFromThirdPartyBuild: [ 'uproxy-obfuscators' 'freedom-port-control' diff --git a/src/lib/samples/simple-socks-node/index.js b/src/lib/samples/simple-socks-node/index.js index 5fdda86031..c6d023e533 100644 --- a/src/lib/samples/simple-socks-node/index.js +++ b/src/lib/samples/simple-socks-node/index.js @@ -1,7 +1,7 @@ var freedom = require('freedom-for-node'); -freedom.freedom('./uproxy-lib/simple-socks/freedom-module.json', { - 'logger': './uproxy-lib/loggingprovider/freedom-module.json', +freedom.freedom('./lib/simple-socks/freedom-module.json', { + 'logger': './lib/loggingprovider/freedom-module.json', 'debug': 'debug' }).then(function(moduleFactory) { moduleFactory();