mirror of
https://github.com/jeremyd/ergo.git
synced 2026-04-26 15:40:00 -07:00
fix #1284
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"regexp"
|
||||
"strings"
|
||||
@@ -193,3 +194,11 @@ func HandleXForwardedFor(remoteAddr string, xForwardedFor string, whitelist []ne
|
||||
// or nil:
|
||||
return
|
||||
}
|
||||
|
||||
func DescribeConn(conn net.Conn) string {
|
||||
// XXX for unix domain sockets, this is not informative enough for an operator
|
||||
// to determine who holds the other side of the connection. there seems to be
|
||||
// no way to get either the correct file descriptor of the connection, or the
|
||||
// udiag_ino from `man 7 sock_diag`. maybe there's something else we can do?
|
||||
return fmt.Sprintf("%s <-> %s", conn.LocalAddr().String(), conn.RemoteAddr().String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user