Skip to content

Commit

Permalink
Added a http service type to enable its resolution with avahi (e.g. r…
Browse files Browse the repository at this point in the history
…unning 'avahi-discovery' or 'avahi-browse -ar') or with a web browser (just surf to 'http://coolserver.local').
  • Loading branch information
Aitor Gómez Goiri committed Dec 30, 2012
1 parent 6a4ee40 commit ddfe053
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions samplecode/nameprobe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
from zeroconf.mdns import Zeroconf


fake_type = '_test-server.local.'

def main( base_name='coolserver.local.'):
def main( base_name='coolserver.local.', stype="_http._tcp.local."):
z = Zeroconf( '' )
try:
name = '%s.%s'%( base_name.split('.')[0], fake_type )
name = '%s.%s'%( base_name.split('.')[0], stype )
s = ServiceInfo(
fake_type,
stype,
name,
server = base_name,
address = socket.inet_aton('127.0.0.1'),
Expand Down

0 comments on commit ddfe053

Please sign in to comment.