Skip to content
Permalink
Browse files
More informative DNS-SD service name
  • Loading branch information
da2x committed Oct 10, 2015
1 parent 4572f4c commit bd932db2a5b72be3bb2155300ef70da2530babc1
Showing with 3 additions and 1 deletion.
  1. +3 −1 nikola/utils.py
@@ -40,6 +40,7 @@
import re
import json
import shutil
import socket
import subprocess
import sys
import dateutil.parser
@@ -1819,6 +1820,7 @@ def dns_sd(port, inet6):
import avahi
import dbus
inet = avahi.PROTO_INET6 if inet6 else avahi.PROTO_INET
name = "{0}'s Nikola Server on {1}".format(os.getlogin(), socket.gethostname())
bus = dbus.SystemBus()
bus_server = dbus.Interface(bus.get_object(avahi.DBUS_NAME,
avahi.DBUS_PATH_SERVER),
@@ -1827,7 +1829,7 @@ def dns_sd(port, inet6):
bus_server.EntryGroupNew()),
avahi.DBUS_INTERFACE_ENTRY_GROUP)
bus_group.AddService(avahi.IF_UNSPEC, inet, dbus.UInt32(0),
'Nikola Server', '_http._tcp', '', '',
name, '_http._tcp', '', '',
dbus.UInt16(port), '')
bus_group.Commit()
return bus_group # remember to bus_group.Reset() to unpublish

4 comments on commit bd932db

@Kwpolska

This comment has been minimized.

Copy link
Member

@Kwpolska Kwpolska replied Oct 13, 2015

How does this work? Who would use this and how?

@da2x

This comment has been minimized.

Copy link
Contributor Author

@da2x da2x replied Oct 13, 2015

  • In Safari on the Mac: Bookmarks menu: Nearby
  • In Epiphany (GNOME Web): Bookmarks menu: Nearby
  • avahi-bookmarks && xdg-open http://localhost:8080
@da2x

This comment has been minimized.

Copy link
Contributor Author

@da2x da2x replied Oct 13, 2015

I use it so I don’t have to remember my computers IP addresses. I preview pages in different browsers and OSes from time to time.

@Kwpolska

This comment has been minimized.

Copy link
Member

@Kwpolska Kwpolska replied Oct 13, 2015

I actually have a tiny DNS server on my home network. http://cassandra.kw:8000/ is a thing.

Please sign in to comment.