A Go-based project for local network service discovery and management.
- Service discovery using mDNS
- Command-line interface (CLI) for starting and managing services
- Docker support for easy deployment
main.go: Entry point for the applicationcmd/: CLI commandsroot.go: Root command definitionstart.go: Start command implementation
mdns/: mDNS responder implementationtestservice/: Example/test service with its own Docker Compose setupDockerfile: Container build instructionsdocker-compose.yml: Multi-service orchestration
- Go 1.18+
- Docker (for containerized usage)
go build -o localdomain
./localdomainBuild and run the container:
docker build -t localdomain .
docker run --rm -it localdomainOr use Docker Compose:
docker-compose up --buildRun the CLI with available commands:
./localdomain startTo enable service discovery and proxying with this repository, your Docker containers must be started with specific labels:
localdomain.enabled=true— Enable localdomain integration for the containerlocaldomain.hostname=your-service.local— The mDNS hostname to advertise (must end with.local)localdomain.port=8080— The internal port your service listens on (used for proxying)
services:
myservice:
image: myimage
labels:
- "localdomain.enabled=true"
- "localdomain.hostname=myservice.local"
- "localdomain.port=8080"
ports:
- "8080:8080"docker run -d \
--label localdomain.enabled=true \
--label localdomain.hostname=myservice.local \
--label localdomain.port=8080 \
-p 8080:8080 \
myimageThe start command will automatically detect containers with these labels, advertise their hostnames via mDNS, and proxy requests to the correct container and port.