# Run with docker
$ docker run -d --rm -p 8080:8080 daehyeok/http_rate_proxy
# Send test http request
$ curl -D- -x localhost:8080 http://fairs.com
HTTP/1.1 200 OK
Date: Fri, 16 Nov 2018 01:06:24 GMT
Content-Length: 1557
Content-Type: text/html; charset=utf-8
go 1.11.* http_rate_proxy will be work with previous versions of GoLang. but it is only tested with GoLang 1.11.
go get command$ go get github.com/daehyeok/http_rate_proxy
Downlaod lastes version from Github release page
Usage of http_rate_proxy
-A, --addr string Address for proxy service (default ":8080")
-B, --burst int Burst for default rate (default 1)
-C, --config string Path for proxy config file
-L, --limit string Limit for default rate (default "inf")
--loglevel string Logging level [panic|fatal|error|warn|info|debug|trace] (default "info"))
http_rate_proxy can controoler with all of traffic, client ip or destination host url. Please see the example configuration file
It use time/rate for rate contiroller with golang.org/x/time/rate package and Token Bucket algorithms
This code is not ready for product level. some of impovement ideas are include garage collection for rate struct, secure connection, reverse proxy.
TravisCI for continue build and test. CodeCov for check code coverage Goreleaser for deploying binary to Github release page. Dockerhub for automatically build to the container GoDoc for documentation
Content type
Image
Digest
Size
211.7 MB
Last updated
almost 8 years ago
docker pull daehyeok/http_rate_proxy