toolman.org/net/peercred (go): Package peercred provides Listener - a net.Listener implementation leveraging the Linux SO_PEERCRED socket option to acquire the PID, UID, and GID of the foreign process connected to each socket. According to the socket(7) manual,  Therefore, peercred.Listener only supports Unix domain sockets and IP connections are not available.  peercred.Listener is intended for use cases where a Unix domain server needs to reliably identify the process on the client side of each connection. By itself, peercred provides support for simple "unix" socket connections. Additional support for gRPC over Unix domain sockets is available with the subordinate package toolman.org/net/peercred/grpcpeer.  A simple, unix-domain server can be written similar to the following:
Keywords: golang|golang-library|identification|linux|networking|socket-programming