Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: ports/tor/tor.js

Issue 1311703003: Added Tor Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ports/tor/pkg_info ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ports/tor/tor.js
diff --git a/ports/tor/tor.js b/ports/tor/tor.js
new file mode 100644
index 0000000000000000000000000000000000000000..9b7540b31a9022c7ad221a693b83301e4f08994e
--- /dev/null
+++ b/ports/tor/tor.js
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+NaClTerm.nmf = 'tor.nmf';
+
+/* check whether another instance of this app is running
+ #TODO(dt) check if default port is occupied
+ #TODO(dt) check if(allowed) another tor process is running outside chrome. */
+function anotherTorRunning(){
+ // since chrome 34 multiple windows in apps are not allowed by default
+ // thus returning false without any checking, (for now)
+ // return NaClTerm.started;
+ return false;
+}
+
+function populateArgv() {
+ //TODO(dt) get parameters from storage once GUI is ready.
+ //tor socks proxy port
+ NaClTerm.argv = ['--SOCKSPort', '9999'];
+ //playing it safe for now,tor creates relays/bridges through
+ // these addresses only
+ NaClTerm.argv = NaClTerm.argv.concat(['ReachableAddresses','*:80,*:443']);
+}
+
+function runTor() {
+ if(!anotherTorRunning()){
+ populateArgv();
+ NaClTerm.init();
+ }
+}
+
+window.onload = function() {
+ lib.init(function() {
+ runTor();
+ });
+};
« no previous file with comments | « ports/tor/pkg_info ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698