Skip to content

Commit

Permalink
active probe handling
Browse files Browse the repository at this point in the history
  • Loading branch information
uoosef committed Nov 23, 2023
1 parent 005b517 commit 9fbbc72
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,18 @@ func handleConnection(clientConn net.Conn) {

if err := clientConn.SetReadDeadline(time.Time{}); err != nil {
log.Println(err)
// HTTP response headers and body
response := "HTTP/1.1 502 OK\r\n" +
"Content-Type: text/plain; charset=utf-8\r\n" +
"Content-Length: 21\r\n" +
"\r\n" +
"nginx, malformed data"

// Write the response to the connection
_, err := clientConn.Write([]byte(response))
if err != nil {
log.Println("Error writing response:", err)
}
return
}

Expand Down

0 comments on commit 9fbbc72

Please sign in to comment.