Documentation
¶
Overview ¶
Package ipc centralises the local IPC between the privileged netscoped daemon and its unprivileged clients (the Wails app and the CLI). Communication is plain HTTP carried over a Unix domain socket — so there is no open TCP port a browser or another user's process could reach; access is gated by the socket file's ownership and permissions instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
Client returns an HTTP client that reaches the daemon over the unix socket. Use any URL host (e.g. http://netscoped/api/health); only the path matters.
func DefaultSocketPath ¶
func DefaultSocketPath() string
DefaultSocketPath is where the daemon listens and clients connect. It is a fixed absolute path (not derived from $HOME) so the root daemon and the user's app/CLI agree on it regardless of who runs them. Override with the NETSCOPE_SOCK environment variable (handy for un-privileged offline dev).
func Listen ¶
Listen creates the unix socket listener for the daemon. It takes a single-instance lock, ensures the parent directory exists, removes a stale socket, and (when running as root) hands ownership of the socket to the target user with 0600 perms so only that user and root can connect.
func NewReverseProxy ¶
func NewReverseProxy(sock string) *httputil.ReverseProxy
NewReverseProxy returns a reverse proxy that forwards requests to the daemon over the unix socket, streaming responses immediately (so SSE works). The Wails asset server mounts this as its fallback handler for /api/*.
Types ¶
This section is empty.