Go to Google Groups Home    Sloppy-discuss
Re: [sloppy-discuss] Sloppy non-GUI version

Richard Dallaway <rich...@dallaway.com>

On 6 Dec 2008, at 11:32, betab...@gmail.com wrote:

> There is a non-gui version mentioned here: http://code.google.com/p/sloppy/wiki/DevelopersStartHere

Yup, that's still in there.  I didn't think it'd be ever used again,  
but yes :-)

> I'd like to run sloppy via a ant action from within Flex Builder (aka
> Eclipse). So this non-gui version would do great (i hope), but I'm not
> quite sure how to set it up. I've checked out from SVN hoping to find
> the mentioned sloppy.jar in there. But I guess, I have to build it
> myself...

The latest JAR file is available here:

http://dallaway.com/sloppy/sloppy.jar

On the Mac if you download that file you can start Sloppy like this  
from Terminal:

$ cd ~/Downloads (or wherever sloppy.jar lives)
$ java -cp /System/Library/Frameworks/JavaVM.framework/Versions/1.5/
Home/lib/javaws.jar:sloppy.jar com.dallaway.sloppy.Sloppy -gui -site http://google.co.uk

Which will output something like:

# Unable to load saved settings: uninitialized
# Starting Sloppy/1.1.118 (en_US)
# Sloppy comes with ABSOLUTELY NO WARRANTY. This is free software, and  
you are welcome to redistribute it under certain conditions. For  
details see <a href='http://www.dallaway.com/sloppy/license.txt'>the  
license</a>
# Listening Port=7569 Destination=http://google.co.uk Bytes per  
second=3225

...and you're set.

To stop it, you have to CTRL-C, and that might be the hardness part to  
deal with when running it from inside Ant.   It wouldn't be hard to  
write an Ant task to start Sloppy, but I'm not sure how to stop it  
from Ant.  That'd need some thought.

I've just noticed that there's no command line option for setting the  
simulation speed (bandwidth).  Not for any reason, other than I never  
did it. You can however specify a properties file:

E.g., create mysettings.properties containing:

sloppy.bytesPerSecond=32250
# oh no, there's a spelling mistake in the code :-( ...
sloppy.desintationURL=http://google.co.uk

Then start sloppy with the name of the file:

java -cp /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/
lib/javaws.jar:sloppy.jar com.dallawasloppy.Sloppy -gui  
mysettings.properties

Not sure how much that helps you...

> Here's where I'm stuck already: I'm a really dummie when it
> comes to build a jar file (so now you probably say, I shouldn't deal
> with source code if I don't even know how to build sth out of it ;)

If you have the source checked out, you can build it with this command:

$ cd sloppy
$ ant -f etc/build.xml compile jar

You may have to change some of the properties (file paths) set up in  
etc/build.xml

> Still, I was hoping somebody can point me in the right direction (or
> tell me where I can find this non-gui version).

> I'm on Mac OS X 10.5.5 with Developer Tools (Apple) and Eclipse
> installed.

> Oh, and thanks for this great utility Richard :)

You're welcome.  Let us know how you're getting on, or if you need  
some changes to support what you're trying to do.

Richard