Merge pull request 'connect mqtt ws colo' (#38) from wisdom into main
Reviewed-on: #38
This commit is contained in:
@@ -292,11 +292,11 @@ const mqttOptions = {
|
|||||||
clientId: 'express_mqtt_client_' + Math.random().toString(16).substr(2, 8),
|
clientId: 'express_mqtt_client_' + Math.random().toString(16).substr(2, 8),
|
||||||
clean: true,
|
clean: true,
|
||||||
connectTimeout: 4000,
|
connectTimeout: 4000,
|
||||||
username: '', // jika ada
|
username: 'morekmorekmorek', // jika ada
|
||||||
password: '', // jika ada
|
password: 'morek888', // jika ada
|
||||||
};
|
};
|
||||||
|
|
||||||
const mqttUrl = 'ws://localhost:1884'; // Ganti dengan broker kamu
|
const mqttUrl = 'ws://117.102.231.130:7001'; // Ganti dengan broker kamu
|
||||||
const topic = process.env.TOPIC_COD ?? 'morek';
|
const topic = process.env.TOPIC_COD ?? 'morek';
|
||||||
|
|
||||||
const mqttClient = mqtt.connect(mqttUrl, mqttOptions);
|
const mqttClient = mqtt.connect(mqttUrl, mqttOptions);
|
||||||
|
|||||||
Reference in New Issue
Block a user