From 2ffb59c349e233e9a6ade23a91fe4297f009bd26 Mon Sep 17 00:00:00 2001 From: Fabrizio Mirabito Date: Mon, 13 Mar 2023 15:00:10 +0100 Subject: [PATCH 1/2] Point to the new production cluster --- src/client/CloudClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/CloudClient.ts b/src/client/CloudClient.ts index 18904d4..6ff94c6 100644 --- a/src/client/CloudClient.ts +++ b/src/client/CloudClient.ts @@ -17,7 +17,7 @@ export class CloudClient implements ICloudClient { private options: CloudOptions = { ssl: false, - host: 'wss.iot.arduino.cc', + host: 'wss-vernemq-production-omega-1858855899.us-east-1.elb.amazonaws.com', port: 8443, token: undefined, useCloudProtocolV2: true, From d338260aad9b6cbb9bbb675dbee712a3f2da0876 Mon Sep 17 00:00:00 2001 From: Fabrizio Mirabito Date: Mon, 13 Mar 2023 15:00:37 +0100 Subject: [PATCH 2/2] reject unauthorized and log userId --- src/connection/Connection.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/connection/Connection.ts b/src/connection/Connection.ts index 8a00540..311a520 100644 --- a/src/connection/Connection.ts +++ b/src/connection/Connection.ts @@ -11,6 +11,7 @@ const BaseConnectionOptions: Partial = { clean: true, keepalive: 30, properties: {}, + rejectUnauthorized: false, protocolVersion: 4, connectTimeout: 30000, }; @@ -44,6 +45,8 @@ export class Connection implements IConnection { username: userId, password: token, }; + console.log(userId); + const connection = new Connection(); connection.client = mqtt.connect(`wss://${host}:${port}/mqtt`, {