Git Product home page Git Product logo

pow-ddos-protected-server's Introduction

Tcp server with PoW DDOS protection

This is a simple tcp server with PoW DDOS protection. It is a simple server that listens for incoming connections and checks if the client has done a PoW before accepting the connection.

PoW algorithm explanation

I was comparing Hashcash to Guided_tour_puzzle_protocol

I choose Hashcash becasue of the simplicity both in implementing and understanding, Guided tour puzzle protocol involves a lot of rounds of rpc calls.

How to build

For building docker images: make dockerbuild make dockerbuildclient

How to use

  1. It can be used just as go binaries. Server: go run ./cmd/server/main.go Client: go run ./cmd/client/main.go localhost:8080
  2. Can be used as docker containers. After you have docker images: docker-compose up - will start both server and client, you can find the quote in client logs. docker compose run client - will restart the client

Possible improvements

  1. I didn't have time to cover the code with unit tests. I would like to add tests for the server and the PoW algorithm.
  2. For distributed environment in-memory cache can be replaced with Redis.
  3. A lot of parameters are hardcoded. It would be nice to move them to the configuration file.

pow-ddos-protected-server's People

Contributors

hweawer avatar

Watchers

 avatar

Forkers

egida

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.