aboutsummaryrefslogtreecommitdiff
path: root/middleware/state.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/state.go')
-rw-r--r--middleware/state.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/middleware/state.go b/middleware/state.go
index 2a7b2ac1d..fb324d780 100644
--- a/middleware/state.go
+++ b/middleware/state.go
@@ -50,6 +50,11 @@ func (s *State) Port() (string, error) {
return port, nil
}
+// RemoteAddr returns the net.Addr of the client that sent the current request.
+func (s *State) RemoteAddr() string {
+ return s.W.RemoteAddr().String()
+}
+
// Proto gets the protocol used as the transport. This
// will be udp or tcp.
func (s *State) Proto() string {