Skip to content
Permalink
Browse files
Document setting the proxyType for metrics
Trac: 32499
  • Loading branch information
arlolra committed Dec 6, 2019
1 parent af4cc52 commit 1e45d48a3c4ef05434916d963f0c00d8c0246ac9
Showing with 16 additions and 8 deletions.
  1. +7 −1 proxy/README.md
  2. +5 −1 proxy/config.js
  3. +1 −2 proxy/init-badge.js
  4. +1 −1 proxy/init-node.js
  5. +1 −1 proxy/init-testing.js
  6. +1 −2 proxy/init-webext.js
@@ -122,7 +122,7 @@ var log = function(msg) {
};
var dbg = log;
var config = new Config();
var config = new Config("myui"); // NOTE: Set a unique proxy type for metrics
var ui = new MyUI(); // NOTE: Using the class defined above
var broker = new Broker(config.brokerUrl);
@@ -134,4 +134,10 @@ snowflake.beginWebRTC();

This minimal setup is pretty much what's currently in `init-node.js`.

When configuring the snowflake, set a unique `proxyType` (first argument
to `Config`) that will be used when recording metrics at the broker. Also,
it would be helpful to get in touch with the [Anti-Censorship Team][2] at the
Tor Project to let them know about your tool.

[1]: https://chrome.google.com/webstore/detail/cupcake/dajjbehmbnbppjkcnpdkaniapgdppdnc
[2]: https://trac.torproject.org/projects/tor/wiki/org/teams/AntiCensorshipTeam
@@ -1,5 +1,9 @@

class Config {}
class Config {
constructor(proxyType) {
this.proxyType = proxyType || '';
}
}

Config.prototype.brokerUrl = 'snowflake-broker.freehaven.net';

@@ -169,8 +169,7 @@ var debug, snowflake, config, broker, ui, log, dbg, init, update, silenceNotific
return;
}

config = new Config;
config.proxyType = "badge";
config = new Config("badge");
if ('off' !== query.get('ratelimit')) {
config.rateLimitBytes = Params.getByteCount(query, 'ratelimit', config.rateLimitBytes);
}
@@ -4,7 +4,7 @@
Entry point.
*/

var config = new Config;
var config = new Config("node");

var ui = new UI();

@@ -79,7 +79,7 @@ var snowflake, query, debug, ui, silenceNotifications, log, dbg, init;

init = function() {
var broker, config, ui;
config = new Config;
config = new Config("testing");
if ('off' !== query['ratelimit']) {
config.rateLimitBytes = Params.getByteCount(query, 'ratelimit', config.rateLimitBytes);
}
@@ -171,8 +171,7 @@ var debug, snowflake, config, broker, ui, log, dbg, init, update, silenceNotific
};

init = function() {
config = new Config;
config.proxyType = "webext";
config = new Config("webext");
ui = new WebExtUI();
broker = new Broker(config);
snowflake = new Snowflake(config, ui, broker);

0 comments on commit 1e45d48

Please sign in to comment.