gin-gonic / gin

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
https://gin-gonic.com/
MIT License
77.57k stars 7.95k forks source link

Add support of NGINX Unit #1654

Open xaionaro opened 5 years ago

xaionaro commented 5 years ago

Please add support of NGINX Unit. It requires to use another ListenAndServe function: https://unit.nginx.org/configuration/#modifying-go-sources

May be it's required to hide the ListenAndServe functions behind an interface to permit another implementations.

phamdt commented 5 years ago

hm, @xaionaro, couldn't you just run ListenAndServe yourself? maybe like...

r := gin.New()
unit.ListenAndServe(whateverYourAddressIs, *r)

looks like the gin router just calls http.ListenAndServe itself after it adds a few conveniences