mirror of
https://github.com/jeremyd/ergo.git
synced 2026-06-22 12:03:03 -07:00
client: Show real IP and whether the target's using TLS in WHOIS
This commit is contained in:
@@ -150,6 +150,15 @@ func (client *Client) IP() net.IP {
|
||||
return net.ParseIP(IPString(client.socket.conn.RemoteAddr()))
|
||||
}
|
||||
|
||||
// IPString returns the IP address of this client as a string.
|
||||
func (client *Client) IPString() string {
|
||||
ip := client.IP().String()
|
||||
if 0 < len(ip) && ip[0] == ':' {
|
||||
ip = "0" + ip
|
||||
}
|
||||
return ip
|
||||
}
|
||||
|
||||
//
|
||||
// command goroutine
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user