Skip to content

Commit

Permalink
Add config option to use hostname/IP for mDNS
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbonney committed Jan 23, 2019
1 parent 01f2f1b commit 8614e3d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nmoscommon/mdns/mdnsListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _buildClientCallback(self, action, info):
"type": info.type,
"name": info.name,
"port": info.port,
"hostname": info.name,
"hostname": info.server.rstrip("."),
"address": inet_ntoa(info.address),
"txt": info.properties
}
2 changes: 1 addition & 1 deletion nmoscommon/mdnsbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def getHref(self, srv_type, priority=None):

def _createHref(self, service):
proto = service['protocol']
if service.get('hostname') is not None:
if service.get('hostname') is not None and self.config["prefer_hostnames"]:
address = service['hostname']
else:
address = service['address']
Expand Down
1 change: 1 addition & 0 deletions nmoscommon/nmoscommonconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"priority": 0,
"https_mode": "disabled",
"prefer_ipv6": False,
"prefer_hostnames": False,
"node_hostname": None,
"fix_proxy": "disabled",
"logging": {
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def create_default_conf():
"priority": 0,
"https_mode": "disabled",
"prefer_ipv6": False,
"prefer_hostnames": False,
"node_hostname": None,
"fix_proxy": "disabled",
"logging": {
Expand Down

0 comments on commit 8614e3d

Please sign in to comment.