Skip to content

Commit dba899c

Browse files
authored
Change mDNS record to note TLS support. (#132)
1 parent 53a3de3 commit dba899c

5 files changed

Lines changed: 225 additions & 191 deletions

File tree

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
**/node_modules/
2+
/.eslintrc.js
23
tmp/

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
run: |
3434
npm install
3535
- name: Lint with eslint
36+
if: ${{ matrix.node-version >= 10 }}
3637
run: |
3738
npm run lint
3839
- name: Run integration tests

lib/server.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -810,15 +810,22 @@ class WebThingServer {
810810
* @returns {Promise} Promise which resolves once the server is started.
811811
*/
812812
start() {
813+
const opts = {
814+
name: this.name,
815+
txt: {
816+
path: '/',
817+
},
818+
};
819+
820+
if (this.app.isTls) {
821+
opts.txt.tls = '1';
822+
}
823+
813824
this.mdns = new dnssd.Advertisement(
814825
new dnssd.ServiceType('_webthing._tcp'),
815826
this.port,
816-
{
817-
name: this.name,
818-
txt: {
819-
path: '/',
820-
},
821-
});
827+
opts
828+
);
822829
this.mdns.on('error', (e) => {
823830
console.debug(`mDNS error: ${e}`);
824831
setTimeout(() => {

0 commit comments

Comments
 (0)