request: Add RemoteAddr helper function

This commit is contained in:
Adnan Maolood 2021-02-27 14:03:33 -05:00
parent 82bdffc1eb
commit f156be19b4
1 changed files with 8 additions and 0 deletions

View File

@ -119,3 +119,11 @@ func (r *Request) ServerName() string {
}
return ""
}
// RemoteAddr returns the remote network address of the client.
func (r *Request) RemoteAddr() net.Addr {
if r.conn != nil {
return r.conn.RemoteAddr()
}
return nil
}