Skip to content

Commit

Permalink
Add timeouts to the server
Browse files Browse the repository at this point in the history
  • Loading branch information
qba73 committed Mar 22, 2024
1 parent 8e1242b commit 62ad389
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hpot.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strconv"
"strings"
"sync"
"time"
)

// Pot represents a Honeypot.
Expand Down Expand Up @@ -52,8 +53,10 @@ func (p *Pot) ListenAndServe() error {
})

s := &http.Server{
Addr: fmt.Sprintf(":%d", p.AdminPort),
Handler: mux,
Addr: fmt.Sprintf(":%d", p.AdminPort),
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
Handler: mux,
}

go func() {
Expand Down

0 comments on commit 62ad389

Please sign in to comment.