Expose as printer in mdns.

Add http handler.
This commit is contained in:
2020-09-19 00:16:58 +02:00
parent a33fdeb808
commit 206e60e400
4 changed files with 33 additions and 2 deletions

View File

@@ -32,8 +32,12 @@ func Run(ctx context.Context) {
if err != nil {
log.Fatalf("GetHostNameFqdn() failed: %v", err)
}
var txt [][]byte
err = eg.AddService(avahi.InterfaceUnspec, avahi.ProtoUnspec, 0, hostname, "_my-nifty-service._tcp", "local", fqdn, 1234, nil)
txt = append(txt, []byte("note=burken"))
txt = append(txt, []byte("product=coola-skrivaren"))
txt = append(txt, []byte("Color=T"))
err = eg.AddService(avahi.InterfaceUnspec, avahi.ProtoUnspec, 0, hostname, "_ipp._tcp", "local", fqdn, 1234, txt)
if err != nil {
log.Fatalf("AddService() failed: %v", err)
}