commit 711b607187040c8ef9b6f68d82ad45a7138d5dfc Author: Jonathan Ellithorpe jdellit@stanford.edu Date: Mon Jul 11 16:38:58 2011 -0700
Added "local" parameter
This parameter can optionally specify the local addr:port to connect to in the case that you are a client swfcat. --- swfcat.as | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/swfcat.as b/swfcat.as index dbf2fb4..76c3829 100644 --- a/swfcat.as +++ b/swfcat.as @@ -26,12 +26,12 @@ package };
/* Local Tor client to use in case of RTMFP connection. */ - private const LOCAL_TOR_CLIENT_ADDR:Object = { + private const DEFAULT_LOCAL_TOR_CLIENT_ADDR:Object = { host: "127.0.0.1", port: 9002 };
- private const MAX_NUM_PROXY_PAIRS:uint = 1; + private const MAX_NUM_PROXY_PAIRS:uint = 2;
// Milliseconds. private const FACILITATOR_POLL_INTERVAL:int = 10000; @@ -52,6 +52,8 @@ package private var num_proxy_pairs:int = 0;
private var fac_addr:Object; + + private var local_addr:Object;
public var rate_limit:RateLimit;
@@ -104,6 +106,13 @@ package return; }
+ if (this.loaderInfo.parameters["local"]) + local_addr = get_param_addr("local", DEFAULT_LOCAL_TOR_CLIENT_ADDR); + else { + local_addr.host = DEFAULT_LOCAL_TOR_CLIENT_ADDR.host; + local_addr.port = DEFAULT_LOCAL_TOR_CLIENT_ADDR.port; + } + if (this.loaderInfo.parameters["client"]) client_main(); else @@ -221,7 +230,7 @@ package proxy_pair = new ProxyPair(this, rs, function ():void { /* Do nothing; already connected. */ }, s_t, function ():void { - s_t.connect(LOCAL_TOR_CLIENT_ADDR.host, LOCAL_TOR_CLIENT_ADDR.port); + s_t.connect(local_addr.host, local_addr.port); }); proxy_pair.connect(); }
tor-commits@lists.torproject.org