mirror of
https://github.com/umputun/reproxy.git
synced 2025-02-16 18:34:30 +02:00
logging rejected IPs
This commit is contained in:
parent
bddb144f60
commit
197c8d9db3
@ -2,6 +2,7 @@ package proxy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
@ -50,6 +51,7 @@ func (o *OnlyFrom) Handler(next http.Handler) http.Handler {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
w.WriteHeader(http.StatusForbidden)
|
w.WriteHeader(http.StatusForbidden)
|
||||||
|
log.Printf("[INFO] ip %q rejected", realIP)
|
||||||
}
|
}
|
||||||
return http.HandlerFunc(fn)
|
return http.HandlerFunc(fn)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user