             }
 
             num_proxy_pairs++;
-            total_proxy_pairs++;
-            /* Update the client count on the badge. */
-            update_client_count();
+            badge.proxy_begin();
 
             proxy_pair = new ProxyPair(this, client_addr, relay_addr);
             proxy_pair.addEventListener(Event.COMPLETE, function(e:Event):void {
                 proxy_pair.log("Complete.");
-                
                 num_proxy_pairs--;
-                /* Update the client count on the badge. */
-                update_client_count();
+                badge.proxy_end();
             });
             proxy_pair.connect();
 

import flash.utils.getTimer;
import flash.utils.setTimeout;

class RateLimit
{
    public function RateLimit()

            output_text.backgroundColor = 0x001f0f;
            output_text.textColor = 0x44cc44;

            badge = new Badge();

            if (RATE_LIMIT)
                rate_limit = new BucketRateLimit(RATE_LIMIT * RATE_LIMIT_HISTORY, RATE_LIMIT_HISTORY);
