GithubHelp home page GithubHelp logo

srcsnk's Introduction

srcsnk

A simple server that sends and receives arbitrary amounts of data at arbitrary speeds. Useful for testing proxies and clients.

Installation

go get -u github.com/bluekeyes/srcsnk

Usage

Run srcsnk to start the server. Once the server is running, you can download a file at any path:

$ curl localhost:8000/an/arbitrary/file.bin?size=10M -o file.bin

Or upload a file to any path:

$ curl -T file.bin localhost:8000/an/arbitrary/path/file.bin

All the received data is discarded by the server.

Each endpoint accepts several paramters described below.

Paramters

  • size – (download only) controls the size of the downloaded file. It takes the suffixes B, K, M, and G for bytes, kilobytes, megabytes, or gigabytes, respectively; these have the same meaning as in the dd command.

  • rate – controls the download or upload rate, in bytes per second. It accepts the same suffixes as the size paramter.

  • delayPre – the amount of time to wait before processing the request, including reading the request body. It accepts any value allowed by time.ParseDuration.

  • delayRes – the amount of time to wait before sending the initial response headers. It accepts any value allowed by time.ParseDuration. For downloads, delayPre and delayRes are interchangeable.

Flags

The command accepts the following flags:

  • -address – sets the address (IP and port) the server listens on; defaults to 127.0.0.1:8000

  • -log-file – sets the file where log output is written; if not provided, logs are written to stdout

srcsnk's People

Contributors

bluekeyes avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.