commit db8e6cbfab6b4d86ea20eeb2e9e151126f90b286 Author: Jonathan Ellithorpe jdellit@stanford.edu Date: Mon Jul 11 18:19:31 2011 -0700
This experiment 01 includes RTMFP, and takes an argument NUM_CLIENTS --- experiments/01 | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-)
diff --git a/experiments/01 b/experiments/01 new file mode 100755 index 0000000..5b446b8 --- /dev/null +++ b/experiments/01 @@ -0,0 +1,73 @@ +#!/bin/bash + +# Get arguments +if [ $1 ]; then + NUM_CLIENTS=$1 +else + NUM_CLIENTS=1 +fi + +# Go to flashproxy repo root dir +cd .. + +# Create 1GB dump file +echo "creating dump file..." +rm dump +dd if=/dev/null of=dump bs=1G seek=1 & + +# Start http server +echo "starting http server..." +thttpd -p 1080 + +# Start crossdomain policy server +echo "starting cross domain policy server..." +sudo ./crossdomaind.py & + +# Start the facilitator +echo "starting facilitator..." +./facilitator.py 4701 -r 127.0.0.1:1080 + +# Start socat adapters +echo "starting socat adapters..." +i=1 +until [ $i -gt $NUM_CLIENTS ]; do + let local_port=2000+i + let remote_port=9000+i + socat TCP-LISTEN:${remote_port},reuseaddr,fork TCP-LISTEN:${local_port},reuseaddr & + let i=i+1 +done + +# Start the flash proxy, client side +echo "starting flash proxy client side..." +i=1 +until [ $i -gt $NUM_CLIENTS ]; do + let local_port=9000+i + google-chrome --app="http://localhost:1080/swfcat.swf?local=127.0.0.1:$%7Blocal_port%7D&clien..." + let i=i+1 + sleep 2 +done + +# Start the flash proxy, server side +echo "starting flash proxy server side..." +google-chrome --app="http://localhost:1080/swfcat.swf?debug=1&facilitator=127.0.0.1:4701" + +let query_fac_time=NUM_CLIENTS+2 +sleep ${query_fac_time} + +# wget the dump file +echo "getting the dump file..." +i=2 +until [ $i -gt $NUM_CLIENTS ]; do + let local_port=2000+i + gnome-terminal -e "/bin/bash -c 'wget http://localhost:$%7Blocal_port%7D/dump -O - > /dev/null; exec /bin/bash -i'" + let i=i+1 +done + +# Use this one for delaying the termination of experiment below +wget http://localhost:2001/dump -O - > /dev/null + +# Slaughter the processes +sudo killall thttpd +ps -ef | sed -n '/crossdomaind.py/{/grep/!p;}' | awk '{print$2}' | sudo xargs -i kill {} +ps -ef | sed -n '/facilitator.py/{/grep/!p;}' | awk '{print$2}' | sudo xargs -i kill {} +sudo killall socat
tor-commits@lists.torproject.org