|
|
@ -4,8 +4,6 @@ import ( |
|
|
|
"errors" |
|
|
|
"net" |
|
|
|
"strconv" |
|
|
|
|
|
|
|
"github.com/eycorsican/go-tun2socks/common/lsof" |
|
|
|
) |
|
|
|
|
|
|
|
var ( |
|
|
@ -16,6 +14,6 @@ var ( |
|
|
|
func GetProcessName(addr net.Addr) string { |
|
|
|
localHost, localPortStr, _ := net.SplitHostPort(addr.String()) |
|
|
|
localPortInt, _ := strconv.Atoi(localPortStr) |
|
|
|
process, _ := lsof.GetCommandNameBySocket(addr.Network(), localHost, uint16(localPortInt)) |
|
|
|
process, _ := GetCommandNameBySocket(addr.Network(), localHost, uint16(localPortInt)) |
|
|
|
return process |
|
|
|
} |
|
|
|