Skip to content

peteretelej/ngao

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ngao

Ngao (shield) - A Golang reverse proxy that limits number of client sessions connected to an upstream server.

Set a number of maximum client sessions, and the clear interval (interval in which older sessions are cleared).

Ngao is useful if you have want to rate limit access to your application/backend server, for example the configuration below only allows 20 sessions at a time.

Example

package main

import "github.com/peteretelej/ngao"

func main() {
	c := &ngao.Config{
		ListenAddr:    ":9015",          // your listen address e.g ":9010"
		Host:          "etelej.com", // the backend server to reverseproxy
		Scheme:        "https",          // protocol scheme of backend host e.g. https, http
		TotalAllowed:  20,                // Maximum client sessions allowed
		ClearInterval: 60 * 5,           // Interval to clear older sessions (secs)
	}
	ngao.Run(c)
}

Contributions welcome & greatly appreciated.

About

Ngao (shield) is a golang reverse proxy for limiting max connections to a server based on a defined max session (don't use, learner go code in action)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages