Coder Social home page Coder Social logo

ddos-load-testing-server's Introduction

DDOS Load Testing Server

HTTP/TCP/UDP server to generate benchmark for benchmark tools.

Where to find benchmark tools

API

Parts

  1. HTTP Control API. It is started with process boot.
  2. Benchmark Server. It is started with start request for HTTP Control API.

HTTP Control API is REST API with methods

  1. HTTP GET /start/:type/:port/:duration?.
  • Request resets Stats and boots up Server of Type on the Port. It changes Status to Started.
  • If Status is not Stopped then it will return 400 HTTP code. Only one Server could run at the same time.
  • If case of success then it will return 200 HTTP code.
  • If Server can't be started then it will return 403 HTTP code.
  • Duration is an optional param. It specifies lifetime of the Benchmark Server in seconds.
  • Benchmark Server session start time (lower boundary) will correspond to the first request.
  1. HTTP GET /stop.
  • Request stops Stats accumulation, kills Server, and returns Stats. It changes Status to Stopped.
  • If Status is not Started then it will return 400 HTTP code.
  • If case of success it will return 200 HTTP code and Stats object.
  1. HTTP GET /stats. 3.1. Request returns latests Stats accumulation without changing State.
  • If Status is not Started then it will return 400 HTTP code.
  • If case of success it will return 200 HTTP code and Stats object.
  • Benchmark Server session stop time (upper boundary) will correspond to the latests request.

Object details

enum Status {
  Started,
  Stopped,
}

enum Type {
  TCP = 'tcp',
  UDP = 'udp',
  HTTP = 'http',
}

interface Stats {
  type: Type,
  duration: {
    seconds: Number,
  },
  requests: {
    total: {
      count: Number,
      bytes: Number,
    },
    average: {
      perSeconds: {
        count: Number,
        bytes: Number,
      },
    },
  },
}

How to start

Without Docker

Prerequisites

  1. Node.js >= 14.17.6.
  2. NPM >= 6.14.15.

Installation

  1. npm i.

Start

  1. To start HTTP Control API on port 8070: npm run start -- -p 8070 or node app -p 8070.

Remarks

  1. Default HTTP Control API port in 8080.
  2. Access to some ports might require root permissions.
  3. You can't start multiple servers of same type.

With Docker

Docker is not implemented yet.

Prerequisites

  1. Docker.

Start

  1. To start HTTP Control API on port 8070 and preplanned exposed port (UDP) for Benchmark Server 8053: docker run -it --rm oknyga/ddos-load-testing-server:latest -p 8070:8080/tcp -p 8053:8053/udp.

Remarks

  1. Same remarks as for Without Docker.
  2. Plan ports you will be using ahead, read Published ports in Container networking documentation of the Docker: https://docs.docker.com/config/containers/container-networking/

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.