Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luickk/godosprotection
low level address based Go DOS/ Brute-force protection
https://github.com/luickk/godosprotection
Last synced: about 9 hours ago
JSON representation
low level address based Go DOS/ Brute-force protection
- Host: GitHub
- URL: https://github.com/luickk/godosprotection
- Owner: luickk
- Created: 2020-12-05T19:57:06.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-07T19:59:30.000Z (almost 4 years ago)
- Last Synced: 2024-06-21T16:54:14.121Z (5 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go DOS Protection
Simple and very low level ip-address(string) based server side denial of service attack protection by limiting connection frequency.
Server Example:
``` go
// initiating DOS protection with 10 second reconnection delay
dp := goDosProtection.New(10)conn, err := ln.Accept()
if err != nil {
fmt.Println(err)
return
}
// client is not banned
if !dp.Client(strings.Split(conn.RemoteAddr().String(), ":")[0]) {
fmt.Println("Accepted client connection")
handleConn(conn)
// client is banned
} else {
fmt.Println("Refused client connection")
}
```