Skip to content

Commit

Permalink
test server - debug new conns
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicriordan committed Dec 2, 2023
1 parent 5a2ec0b commit e1cd84e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/payloader/test-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ var runServerCmd = &cobra.Command{
var err error

server := fasthttp.Server{
ConnState: func(c net.Conn, s fasthttp.ConnState) {
if debug {
if s == fasthttp.StateNew {
log.Println("new conn")
}
}
},
Handler: func(c *fasthttp.RequestCtx) {
_, err = c.WriteString(response)
if err != nil {
Expand Down

0 comments on commit e1cd84e

Please sign in to comment.