0.0
No release in over 3 years
Low commit activity in last 3 years
Simple web server and client with adjustable delays for testing timeouts on clients, servers and proxy servers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 0.10
~> 10.0
~> 3.0
 Project Readme

SlowServer

CircleCI Code Climate Test Coverage

This Gem has two parts, slow_server and slow_client, together they can be used to test timeouts in various stages of connections.

Currently there are two types of delays supported by both client and server, initial delay and chunk delay.

Initial delay (--delay) causes both client and server to wait some amount of seconds after the connection is opened before sending anything.

Chunk delay (--chunk-delay) works together with chunk count (--chunks) to split the message into chunks and send them one chunk at a time with some delay between. You can think of this similar to Chunked Encoding for HTTP, but it's not actually using Chunked Encoding

Installation

$ gem install slow_server

Usage

###slow_client

slow_client is somewhat similar to slowloris, it has tunable delays for various different phases of connection.

$ slow_client --help
Usage: slow_client [OPTIONS] [URI]
    -X, --method METHOD              Request Method                      (default: GET)
    -p, --port NUMBER                Listen Port                         (default: 4000)
    -c, --chunks BYTES               Chunks                              (default: 1)
    -d, --delay SECONDS              Transmission delay after connecting (default: 0)
    -k, --chunk-delay SECONDS        Delay between chunks                (default: 0)
    -v, --version                    Show Version

###slow_server

slow_server is the counterpart to slow_client, by default it will respond with the story of The Tortoise and The Hare, but it too has tunable delays.

$ slow_server --help
Usage: slow_server [OPTIONS] [RESPONSE]
    -p, --port NUMBER                Listen Port                         (default: 4000)
    -c, --chunks BYTES               Chunks                              (default: 1)
    -d, --delay SECONDS              Transmission delay after connecting (default: 0)
    -k, --chunk-delay SECONDS        Delay between chunks                (default: 0)
    -v, --version                    Show Version

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jscholl/slow_server.

License

The gem is available as open source under the terms of the MIT License.