https://github.com/brandonkramer/ipc
Cross-platform local transport for service daemons: Unix domain sockets, Windows named pipes, and HTTP-over-Unix helpers.
https://github.com/brandonkramer/ipc
cross-platform daemons go golang ipc library named-pipe unix-socket
Last synced: 14 days ago
JSON representation
Cross-platform local transport for service daemons: Unix domain sockets, Windows named pipes, and HTTP-over-Unix helpers.
- Host: GitHub
- URL: https://github.com/brandonkramer/ipc
- Owner: brandonkramer
- License: mit
- Created: 2026-05-31T18:46:58.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-31T19:14:28.000Z (about 1 month ago)
- Last Synced: 2026-05-31T21:12:36.439Z (about 1 month ago)
- Topics: cross-platform, daemons, go, golang, ipc, library, named-pipe, unix-socket
- Language: Go
- Size: 58.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ipc
Cross-platform local transport for service daemons: Unix domain sockets, Windows named pipes, detached child spawn, and optional HTTP-over-Unix helpers.
## Quick start
```go
addr := ipc.Addr{
Unix: "/var/run/mysvc/rpc.sock",
PipePrefix: "mysvc",
PipeKey: "/data/mysvc-home",
}
ln, err := ipc.Listen(addr)
conn, err := ipc.Dial(ctx, addr)
ipc.SetDetach(cmd)
```
## With svcroot
```go
layout := svcroot.Layout{SocketName: "rpc.sock", PipePrefix: "mysvc"}
addr := ipc.Addr{
Unix: svcroot.Socket(root, &layout),
PipePrefix: layout.WithDefaults().PipePrefix,
PipeKey: root,
}
```
## HTTP over Unix (Unix only)
```go
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
go func() { _ = ipc.RunUnixHTTP(ctx, "/var/run/mysvc/observe.sock", true, mux) }()
client := ipc.NewUnixHTTPClient("/var/run/mysvc/observe.sock")
err := client.Get(ctx, "/status", &out)
```