Skip to content

Instantly share code, notes, and snippets.

View bogushevich's full-sized avatar

Maxim Bogushevich bogushevich

View GitHub Profile
@joncfoo
joncfoo / main.go
Last active May 28, 2025 03:56
Peer Credentials from Unix Domain Socket
// Unix Domain Socket Peer Credentials
//
// This program demonstrates setting up a HTTP server over a Unix Domain Socket
// and subsequently obtaining connecting clients credentials. The credentials
// contain the User ID, Group ID, and Process ID of the incoming connection (as
// connections are made by some local system user as opposed to a network
// connection).
//
// This has interesting use cases around local process security. For example,
// a server listening on a Unix Domain Socket can choose to allow or reject