Skip to content

Commit

Permalink
Change mDNS record to note TLS support. (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstegeman authored Jun 18, 2020
1 parent 53a3de3 commit dba899c
Show file tree
Hide file tree
Showing 5 changed files with 225 additions and 191 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/node_modules/
/.eslintrc.js
tmp/
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
run: |
npm install
- name: Lint with eslint
if: ${{ matrix.node-version >= 10 }}
run: |
npm run lint
- name: Run integration tests
Expand Down
19 changes: 13 additions & 6 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,15 +810,22 @@ class WebThingServer {
* @returns {Promise} Promise which resolves once the server is started.
*/
start() {
const opts = {
name: this.name,
txt: {
path: '/',
},
};

if (this.app.isTls) {
opts.txt.tls = '1';
}

this.mdns = new dnssd.Advertisement(
new dnssd.ServiceType('_webthing._tcp'),
this.port,
{
name: this.name,
txt: {
path: '/',
},
});
opts
);
this.mdns.on('error', (e) => {
console.debug(`mDNS error: ${e}`);
setTimeout(() => {
Expand Down
Loading

0 comments on commit dba899c

Please sign in to comment.