client: Show real IP and whether the target's using TLS in WHOIS

This commit is contained in:
Daniel Oaks
2017-06-23 05:15:10 +10:00
parent 1c0c4841a1
commit 23a26f83fe
3 changed files with 17 additions and 0 deletions
+9
View File
@@ -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
//