aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mobius-hotline-server/main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/mobius-hotline-server/main.go b/cmd/mobius-hotline-server/main.go
index 6b82764..e2c7789 100644
--- a/cmd/mobius-hotline-server/main.go
+++ b/cmd/mobius-hotline-server/main.go
@@ -7,6 +7,7 @@ import (
"fmt"
"github.com/jhalter/mobius/hotline"
"github.com/jhalter/mobius/internal/mobius"
+ "github.com/oleksandr/bonjour"
"io"
"log"
"os"
@@ -168,6 +169,12 @@ func main() {
// Assign functions to handle specific Hotline transaction types
mobius.RegisterHandlers(srv)
+ s, err := bonjour.Register(srv.Config.Name, "_hotline._tcp", "", *basePort, []string{"txtv=1", "app=hotline"}, nil)
+ if err != nil {
+ slogger.Error("Error registering Hotline server with Bonjour", "err", err)
+ }
+ defer s.Shutdown()
+
// Serve Hotline requests until program exit
log.Fatal(srv.ListenAndServe(ctx))
}