it seems the custom handler wasn't being used
This commit is contained in:
parent
d0d19778a4
commit
330263028e
1 changed files with 13 additions and 9 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
const dgram = require('dgram')
|
||||||
const OSC = require('osc-js');
|
const OSC = require('osc-js');
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
|
|
@ -18,6 +19,9 @@ const config = {
|
||||||
port: 8080, // @param {number} Port of WebSocket server
|
port: 8080, // @param {number} Port of WebSocket server
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const osc = new OSC({ plugin: new OSC.BridgePlugin(config) });
|
const osc = new OSC({ plugin: new OSC.BridgePlugin(config) });
|
||||||
|
|
||||||
osc.open(); // start a WebSocket server on port 8080
|
osc.open(); // start a WebSocket server on port 8080
|
||||||
|
|
@ -27,15 +31,15 @@ console.log('osc server running on port', config.udpServer.port);
|
||||||
console.log('websocket server running on port', config.wsServer.port);
|
console.log('websocket server running on port', config.wsServer.port);
|
||||||
|
|
||||||
// listen for messages from the client
|
// listen for messages from the client
|
||||||
osc.on('*', (m) => {
|
// osc.on('*', (m) => {
|
||||||
console.log("hmm!");
|
// console.log("hmm!");
|
||||||
const ts = m.args.shift();
|
// const ts = m.args.shift();
|
||||||
const message = new OSC.Message(m.address, ...m.args);
|
// const message = new OSC.Message(m.address, ...m.args);
|
||||||
console.log(m.args);
|
// console.log(m.args);
|
||||||
const bundle = new OSC.Bundle([message], new Date(ts))
|
// const bundle = new OSC.Bundle([message], new Date(ts))
|
||||||
osc.send(bundle);
|
// osc.send(bundle);
|
||||||
console.log('forward:', bundle);
|
// console.log('forward:', bundle);
|
||||||
});
|
// });
|
||||||
|
|
||||||
/*
|
/*
|
||||||
example tidal messages:
|
example tidal messages:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue