2024-10-04 09:38:27 +02:00
|
|
|
'use strict';
|
|
|
|
const { Client, Message } = require('node-osc');
|
2023-12-06 11:59:35 +01:00
|
|
|
|
2024-10-04 09:38:27 +02:00
|
|
|
const client = new Client('127.0.0.1', 3333);
|
|
|
|
|
|
|
|
const message = new Message('/address');
|
|
|
|
message.append('testing');
|
|
|
|
message.append('testing');
|
|
|
|
message.append(123);
|
|
|
|
|
|
|
|
client.send(message, (err) => {
|
|
|
|
if (err) {
|
|
|
|
console.error(new Error(err));
|
|
|
|
}
|
|
|
|
client.close();
|
|
|
|
});
|
2023-12-06 11:59:35 +01:00
|
|
|
|
|
|
|
// or
|
2024-10-04 09:38:27 +02:00
|
|
|
// client.send('/address', 'testing', 'testing', 123);
|
2023-12-06 11:59:35 +01:00
|
|
|
|
|
|
|
// or
|
2024-10-04 09:38:27 +02:00
|
|
|
// const msg = new Message('/address', 1, 2, 3);
|
2023-12-06 11:59:35 +01:00
|
|
|
// client.send(msg);
|