Expose as printer in mdns.
Add http handler.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user