forked from coolaj86/goldilocks.js
temp disable of direct mDNS responses
This commit is contained in:
parent
49d5e5296a
commit
8fb70564db
14
lib/mdns.js
14
lib/mdns.js
|
@ -137,13 +137,15 @@ module.exports.start = function (deps, config, mainPort) {
|
||||||
|
|
||||||
randomId.get().then(function (name) {
|
randomId.get().then(function (name) {
|
||||||
var resp = createResponse(name, packet, config.mdns.ttl, mainPort);
|
var resp = createResponse(name, packet, config.mdns.ttl, mainPort);
|
||||||
var now = Date.now();
|
// TODO: uncomment the lines below after the demo and fix the installer so that
|
||||||
if (now > nextBroadcast) {
|
// it can get the direct responses even on macOS.
|
||||||
|
// var now = Date.now();
|
||||||
|
// if (now > nextBroadcast) {
|
||||||
socket.send(resp, config.mdns.port, config.mdns.broadcast);
|
socket.send(resp, config.mdns.port, config.mdns.broadcast);
|
||||||
nextBroadcast = now + config.mdns.ttl * 1000;
|
// nextBroadcast = now + config.mdns.ttl * 1000;
|
||||||
} else {
|
// } else {
|
||||||
socket.send(resp, rinfo.port, rinfo.address);
|
// socket.send(resp, rinfo.port, rinfo.address);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue