mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 10:10:08 -08:00
fix #1284
This commit is contained in:
parent
0ca27cfeda
commit
bcdf61bd7a
3 changed files with 17 additions and 4 deletions
|
|
@ -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())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue