Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cevatbarisyilmaz committed Aug 20, 2018
1 parent a4b8d80 commit 5a885aa
Showing 1 changed file with 6 additions and 46 deletions.
52 changes: 6 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,14 @@
# plistener

[![GoDoc](https://godoc.org/github.com/cevatbarisyilmaz/plistener?status.svg)](https://godoc.org/github.com/cevatbarisyilmaz/plistener)
[![GitHub license](https://img.shields.io/github/license/cevatbarisyilmaz/plistener.svg)](https://github.com/cevatbarisyilmaz/plistener/blob/master/LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/cevatbarisyilmaz/plistener)](https://goreportcard.com/report/github.com/cevatbarisyilmaz/plistener)
[![GitHub release](https://img.shields.io/github/release/cevatbarisyilmaz/plistener.svg)](https://github.com/cevatbarisyilmaz/plistener/releases/)

plistener is a spam-resistant TCP listener package for Go.

## Download
### Download

```
go get github.com/cevatbarisyilmaz/plistener
```

## Usage

TCP Sockets
```go
//Create a PListener from a TCP Listener
listener := plistener.New(tcpListener)
for {
//Start accepting connections
TCPConn, err := listener.Accept()
if err != nil{
//Handle error
}
go handleConn(TCPConn) //Handle conn
}
```

HTTP Server
```go
//Create a PListener from a TCP Listener
listener := plistener.New(tcpListener)
//Init the server
server := &http.Server{}
//Serve HTTP over PListener
server.Serve(listener)
```

## Documentation

See [godoc](https://godoc.org/github.com/cevatbarisyilmaz/plistener).

## Features

- [x] Maximum Total Open Connections Limit
- [x] Maximum Open Connections With a Single IP Limit
- [x] Maximum New Connections With a Single IP in a Time Interval
- [x] IP-Ban

## Contributing

PRs welcome.

## License

[MIT](https://github.com/cevatbarisyilmaz/plistener/blob/master/LICENSE)

0 comments on commit 5a885aa

Please sign in to comment.