I don't think you can limit the number of requests by the *MaxRequestsPerConn* of fasthttp, because the Conn in this func is new struct created by fasthttp which stores in pool. Real client connections will be send to channels which be processed by these Conns.
For @ Tamás , Server.ConnState applies to net connections, not request on the keep-live connection. On Monday, January 13, 2020 at 3:00:10 PM UTC+8, zohaib...@doordash.com wrote: > > Hey folks, > > I've been digging around for a while but could not find anything; is > there something with builtin HTTP server that I can do to limit the maximum > number of requests allowed with KeepAlive connection? I found fast http > provides an option *MaxRequestsPerConn* to do so, > https://github.com/valyala/fasthttp/blob/59b28fe0e54664073ac4e422511ca8af718b26b0/server.go#L233-L239 > is > there something out of the box too? If not I really want to stick to stock > net/http package; is there a quick cheap way to do that? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/05a4ceba-5ed0-4be7-8c3c-3e2544c63ccb%40googlegroups.com.